Skip to content

SqueakQL sorting and pagination

Use PostgreSQL-style ORDER BY after the predicate:

status <> 'done'
ORDER BY priority DESC, updated_at DESC

Use ASC or DESC. Sortable fields are key, project_key, title, type, status, priority, created_at, and updated_at. Nullable relationship and estimate fields are filterable but are not sortable in v1.

Without an explicit order, results use updated_at DESC. Priority ordering is semantic: ascending is low, medium, high, urgent, and descending is the reverse. Status and type ordering use their stored text values.

Hamstik appends Work Item key and id tiebreakers when needed. The API owns page size and cursor pagination; SqueakQL does not support LIMIT or OFFSET.

For the public API, send the returned cursor unchanged in the next POST body. Changing the query, order, Organization, user, or PAT resource grants invalidates the cursor. Permissions are checked again for every request.

All effective sort values and deterministic tiebreakers are preserved, including timestamp precision. Repeated sort fields use their first occurrence. Cursors may contain up to 8,192 characters; send them back unchanged.

Pagination uses the last row’s sort position, not a snapshot of the database. Concurrent edits to sort values can move rows across a page boundary; inserts, deletions, and permission changes can alter later pages. Start a new search to refresh the result set.