compileLimitOffset method

String compileLimitOffset(
  1. int? limit,
  2. int? offset,
  3. Compilation c
)

LIMIT/OFFSET fragment (MySQL needs a limit when offset is given).

Implementation

String compileLimitOffset(int? limit, int? offset, Compilation c) {
  final buffer = StringBuffer();
  if (limit != null) {
    buffer.write(' LIMIT ${c.bind(limit)}');
  }
  if (offset != null) {
    buffer.write(' OFFSET ${c.bind(offset)}');
  }
  return buffer.toString();
}