generateSelectSQL method

FutureOr<SQL> generateSelectSQL(
  1. Transaction transaction,
  2. String entityName,
  3. String table,
  4. EntityMatcher matcher, {
  5. Object? parameters,
  6. List? positionalParameters,
  7. Map<String, Object?>? namedParameters,
  8. int? limit,
})

Implementation

FutureOr<SQL> generateSelectSQL(Transaction transaction, String entityName,
    String table, EntityMatcher matcher,
    {Object? parameters,
    List? positionalParameters,
    Map<String, Object?>? namedParameters,
    int? limit}) {
  return _generateSQLFrom(transaction, entityName, table, matcher,
      parameters: parameters,
      positionalParameters: positionalParameters,
      namedParameters: namedParameters,
      limit: limit, sqlBuilder: (String from, EncodingContext context) {
    var tableAlias = context.resolveEntityAlias(table);
    var q = dialect.elementQuote;
    var limitStr = limit != null && limit > 0 ? ' LIMIT $limit' : '';
    var sql = 'SELECT $q$tableAlias$q.* $from$limitStr';
    return sql;
  });
}