Add df.status_by_label() and clarify df.status() requires instance_id#181
Draft
Copilot wants to merge 4 commits into
Draft
Add df.status_by_label() and clarify df.status() requires instance_id#181Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
… not label - Add `df.status_by_label(label TEXT)` Rust function in src/monitoring.rs that returns the status of the most recently started instance with the given label, returning NULL when no match exists (respects RLS) - Register the function in sql/pg_durable--0.1.1.sql - Update docs/api-reference.md: add note on df.status() warning about label vs instance_id confusion, and add full df.status_by_label() documentation entry - Update USER_GUIDE.md Quick Status Check section with df.status_by_label() example and a tip explaining the label vs instance_id distinction - Update .github/skills/pg-durable-sql/SKILL.md with status_by_label reference - Extend tests/e2e/sql/05_monitoring_and_explain.sql to exercise status_by_label for both a known label and an unknown label Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
- Add CREATE OR REPLACE FUNCTION df.status_by_label to the 0.2.1→0.2.2 upgrade script so users upgrading from 0.2.1 also receive the new function - Update docs/upgrade-testing.md to include df.status_by_label() in the monitoring functions table for upgrade scenario tests Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
…error handling note - docs/api-reference.md: remove 'eight-character hex' from df.status() note; use 'unique identifier returned by df.start()' instead - tests/e2e/sql/05_monitoring_and_explain.sql: add comment clarifying status_by_label test uses the same label as the df.start() call above it - src/monitoring.rs: document the NULL-on-error behaviour of status_by_label and note its intentional consistency with df.status() Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Clarify that df.status() accepts instance_id, not label
Add df.status_by_label() and clarify df.status() requires instance_id
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.status()accepts aninstance_id, not a label — passing a label silently returnsNULL, making it easy for callers who usedf.start(..., 'my-label')to unknowingly query the wrong identifier.New function:
df.status_by_label(label TEXT)Returns the status of the most recently started instance matching the given label. Respects RLS (queries via SPI). Returns
NULLwhen no visible instance matches.Changes
src/monitoring.rs—status_by_labelimplementation; documents NULL-on-error behaviour (consistent withdf.status())sql/pg_durable--0.1.1.sql— C wrapper registration for fresh installssql/pg_durable--0.2.1--0.2.2.sql—CREATE OR REPLACE FUNCTIONfor the upgrade pathdocs/api-reference.md— warning note ondf.status()clarifying it needs aninstance_id; full entry fordf.status_by_label()USER_GUIDE.md— updated Quick Status Check section with label-based example and tipdocs/upgrade-testing.md— addeddf.status_by_label()to the monitoring functions tabletests/e2e/sql/05_monitoring_and_explain.sql— tests correct status for a known label andNULLfor an unknown one