Skip to content

Add transaction status tracking#106

Merged
SeanTAllen merged 3 commits intomainfrom
add-transaction-status-tracking
Feb 12, 2026
Merged

Add transaction status tracking#106
SeanTAllen merged 3 commits intomainfrom
add-transaction-status-tracking

Conversation

@SeanTAllen
Copy link
Member

Expose the PostgreSQL ReadyForQuery status byte to users via a new TransactionStatus union type and pg_transaction_status callback on SessionStatusNotify.

The callback fires after every query cycle completes (including the initial ready signal after authentication), reporting TransactionIdle, TransactionInBlock, or TransactionFailed. Non-breaking — the callback has a default no-op body.

Replaces the three internal boolean methods on _ReadyForQueryMessage (idle(), in_transaction_block(), failed_transaction()) with a single transaction_status() method returning the public type.

Design: #102

Expose the PostgreSQL ReadyForQuery status byte to users via a new
TransactionStatus union type and pg_transaction_status callback on
SessionStatusNotify. The callback fires after every query cycle
completes (including the initial ready signal after authentication),
reporting TransactionIdle, TransactionInBlock, or TransactionFailed.

The three boolean methods on _ReadyForQueryMessage (idle(),
in_transaction_block(), failed_transaction()) are replaced by a single
transaction_status() method that returns the public TransactionStatus
type.

Non-breaking: the callback has a default no-op body, so existing
SessionStatusNotify implementations are unaffected.

Design: #102
@SeanTAllen SeanTAllen added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 12, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 12, 2026
The example demonstrates the pg_transaction_status callback, not
transactions themselves.
Remove table scaffolding that wasn't relevant to the callback being
demonstrated. The example now just sends BEGIN and COMMIT to show the
status changing from idle to in-transaction and back.
@SeanTAllen SeanTAllen merged commit 2aa8eee into main Feb 12, 2026
8 checks passed
@SeanTAllen SeanTAllen deleted the add-transaction-status-tracking branch February 12, 2026 19:24
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 12, 2026
github-actions bot pushed a commit that referenced this pull request Feb 12, 2026
github-actions bot pushed a commit that referenced this pull request Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - added Automatically add "Added" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants