Skip to content

Add named prepared statement support#78

Merged
SeanTAllen merged 1 commit intomainfrom
named-prepared-statements
Feb 10, 2026
Merged

Add named prepared statement support#78
SeanTAllen merged 1 commit intomainfrom
named-prepared-statements

Conversation

@SeanTAllen
Copy link
Member

Implements the design from discussion #77. Adds Session.prepare() to create server-side named statements, Session.close_statement() to destroy them, NamedPreparedQuery to execute them, and PrepareReceiver for prepare lifecycle callbacks.

Breaking change: the Query union type expands to include NamedPreparedQuery, requiring a new branch in exhaustive matches.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 10, 2026
@SeanTAllen SeanTAllen added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 10, 2026
Implements the design from discussion #77. Adds server-side named
prepared statements: parse SQL once with Session.prepare(), execute
multiple times with NamedPreparedQuery, clean up with
Session.close_statement(). PrepareReceiver interface provides
prepare lifecycle callbacks.

New queue item union type (_QueueItem) replaces the tuple-based queue
to support three operation types: queries, prepares, and close
statements. Two new in-flight states (_PrepareInFlight,
_CloseStatementInFlight) handle the protocol sequences.

Design: #77
@SeanTAllen SeanTAllen force-pushed the named-prepared-statements branch from 5b63a64 to 75644b2 Compare February 10, 2026 20:33
@SeanTAllen SeanTAllen merged commit a4892da into main Feb 10, 2026
8 checks passed
@SeanTAllen SeanTAllen deleted the named-prepared-statements branch February 10, 2026 20:48
github-actions bot pushed a commit that referenced this pull request Feb 10, 2026
github-actions bot pushed a commit that referenced this pull request Feb 10, 2026
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 10, 2026
SeanTAllen added a commit that referenced this pull request Feb 10, 2026
Reflects PR #78: NamedPreparedQuery, PrepareReceiver, _QueueItem
union, _PrepareInFlight/_CloseStatementInFlight states, new frontend
messages, new tests, example, and updated supported features.
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