buildLimitClause static method

String buildLimitClause(
  1. int limit, [
  2. int? offset
])

Build a LIMIT/OFFSET clause.

Implementation

static String buildLimitClause(int limit, [int? offset]) {
  if (_driver == DBDriver.postgres) {
    return offset != null ? 'LIMIT $limit OFFSET $offset' : 'LIMIT $limit';
  } else {
    return offset != null ? 'LIMIT $offset, $limit' : 'LIMIT $limit';
  }
}