Add indexed, timestamped, cursor-paginated instance listing APIs#182
Draft
Copilot wants to merge 2 commits into
Draft
Add indexed, timestamped, cursor-paginated instance listing APIs#182Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update df.instances to support efficient pagination for external clients
Add indexed, timestamped, cursor-paginated instance listing APIs
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
df.instanceslisting was expensive for external clients because chronological reads had no supporting index,df.list_instanceshad no server-side pagination, and timestamps were omitted from the response. This made efficient page-by-page UI listing and metadata display harder than necessary.Schema/index changes
idx_instances_created_at_desc_idon(created_at DESC, id).df.list_instancescontract updatecreated_atcompleted_atORDER BY created_at DESC, id DESCfor deterministic chronological output.limit_counttruncation with explicit bound validation.New paginated API
df.list_instances_paginated(status_filter, limit_count, after_cursor).(created_at, id)withlimit + 1lookahead.total_countnext_cursor(orNULLwhen exhausted)status_filterunder existing RLS behavior.Privilege/documentation updates
df.list_instances_paginated(text, integer, text)todf.grant_usage(...)function grants.