Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepared statement support #87

Merged
merged 34 commits into from
Jan 10, 2024
Merged

Prepared statement support #87

merged 34 commits into from
Jan 10, 2024

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Jan 5, 2024

This PR implements postgres prepared statements with support for $1 style parameters in query strings. If this approach is reasonable, the next step would be to add support for additional types and lots more tests.

Also missing is support for the client manually specifying the types of parameters in a Parse message, which is required for certain statements where the type information cannot be determined based on referenced columns.

Companion PRs:

dolthub/go-mysql-server#2239
dolthub/vitess#299

Copy link
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Really glad you're tackling this. Small nitpick comments, but the core logic looks good to me! Not straightforward, however I think that's just the nature of the beast.

postgres/messages/row_description.go Outdated Show resolved Hide resolved
server/ast/expr.go Show resolved Hide resolved
server/listener.go Outdated Show resolved Hide resolved
testing/go/framework.go Outdated Show resolved Hide resolved
testing/go/prepared_statement_test.go Outdated Show resolved Hide resolved
@zachmu zachmu marked this pull request as ready for review January 10, 2024 23:33
@zachmu zachmu merged commit 5e70284 into main Jan 10, 2024
7 checks passed
@zachmu zachmu deleted the zachmu/prepared branch January 10, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants