Query constructor

Query(
  1. SQLite sqlite,
  2. List<SqlX> columns,
  3. SqlX? search,
  4. SqlX? where,
  5. List<QueryOrdering> order,
  6. QueryDistinction distinction,
  7. int limit,
)

Implementation

Query(
  this.sqlite,
  this.columns,
  this.search,
  this.where,
  this.order,
  this.distinction,
  this.limit,
) {
  String strAllColumns = [
    columnRowId,
    columnKeyId,
    for (var ordering in order) ////
      ordering.expression.str,
    for (var column in columns) ////
      column.str,
  ].join(", ");
  String strFrom = search == null ? tableMapping : search!.str;
  String strWhere = where == null ? "" : "${where!.str} AND ";
  _msgSelect = MessageFormat(
    "SELECT $strAllColumns FROM $strFrom "
    "WHERE $strWhere{0} ORDER BY {1} LIMIT $limit",
  );
  initialize();
}