Skip to content

Commit 7cd6751

Browse files
feat: add offset (#326)
Co-authored-by: [email protected] <[email protected]>
1 parent 193c8df commit 7cd6751

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

postgrest/base_request_builder.py

+11
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,17 @@ def limit(self: Self, size: int, *, foreign_table: Optional[str] = None) -> Self
485485
)
486486
return self
487487

488+
def offset(self: _FilterT, size: int) -> _FilterT:
489+
"""Set the starting row index returned by a query.
490+
Args:
491+
size: The number of the row to start at
492+
"""
493+
self.params = self.params.add(
494+
"offset",
495+
size,
496+
)
497+
return self
498+
488499
def range(self: Self, start: int, end: int) -> Self:
489500
self.headers["Range-Unit"] = "items"
490501
self.headers["Range"] = f"{start}-{end - 1}"

0 commit comments

Comments
 (0)