range method
Limits the result to rows within the specified range, inclusive.
If we want to limit a foreign column, the options
need to have foreignTable
value provided
postgrest.from('users').select('messages(*)').range(1, 1, foreignTable: 'messages')
Implementation
PostgrestTransformBuilder range(int from, int to, {String? foreignTable}) {
final keyOffset = foreignTable == null ? 'offset' : '$foreignTable.offset';
final keyLimit = foreignTable == null ? 'limit' : '$foreignTable.limit';
appendSearchParams(keyOffset, '$from');
appendSearchParams(keyLimit, '${to - from + 1}');
return this;
}