generateSelectSQL method
FutureOr<SQL>
generateSelectSQL(
- Transaction transaction,
- String entityName,
- String table,
- EntityMatcher matcher, {
- Object? parameters,
- List? positionalParameters,
- Map<
String, Object?> ? namedParameters, - 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;
});
}