src/Db/Db.js
/**
	 * Build a where clause from an object of field-value pairs.
	 * Used internally by #selectFrom, #updateTable, #deleteFrom
	 * @see Db#buildWhere
	 * @param {Object} wheres  An object with field-value pairs (field may be field space operator)
	 * @return {String}
	 * @example
	 * db.buildWheres({
	 *     'start_date BETWEEN: ['2012-01-01','2013-01-01'],
	 *     'start_date >': '2013-01-01',
	 *     'start_date !=': '2013-01-01',
	 *     'start_date': null, // `start_date` IS NULL
	 *     'start_date !=': null, // `start_date` IS NOT NULL
	 *     id: [1,2,3], // `id` IN (1,2,3)
	 *     'id !=': [1,2,3], // `id` NOT IN (1,2,3)
	 *     'id IN': [1,2,3], // `id` IN (1,2,3)
	 *     'id NOT IN': [1,2,3], // `id` NOT IN (1,2,3)
	 * })
	 */
Build a where clause from an object of field-value pairs.
Build a where clause from an object of field - value pairs .
buildWheres(wheres) {
		const clauses = [];
		for (const field in wheres) {
			if (!wheres.hasOwnProperty(field)) {
				continue;
			}
			clauses.push(this.buildWhere(field, wheres[field]));
		}
		return clauses.length ? clauses.join(' AND ') : '1';
	}
buildWheres ( wheres ) { const clauses = [ ] ; for ( const field in wheres ) { if ( ! wheres . hasOwnProperty ( field ) ) { continue ; } clauses . push ( this . buildWhere ( field , wheres [ field ] ) ) ; } return clauses . length ? clauses . join ( ' AND ' ) : '1' ; }
Build a where clause from an object of field-value pairs.
Build a where clause from an object of field - value pairs .