DbQueryAnd - do-/node-doix-db GitHub Wiki

DbQueryAnd is a class representing SQL boolean term:

<boolean factor> [AND <boolean term> AND <boolean factor> AND...]

Properties

Name Type Description
filters Array list of {sql, params} objects, such as DbQueryTableColumnComparison instances
sql String The SQL fragment to be interpolated in the query: all filters' sql concatenated with AND
params Array The list of parameters corresponding to all ? placeholders in sql: all filters' params merged together

Static methods

from

For a given filters list, removes all null entries from it and then:

  • if not one entry is left, returns null;
  • if a single filter is left, returns it;
  • otherwise, constructs and returns the corresponding DbQueryAnd instance.