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

Postgres PREPARED STATEMENT example #507

Open
duncangroenewald opened this issue Sep 14, 2024 · 3 comments
Open

Postgres PREPARED STATEMENT example #507

duncangroenewald opened this issue Sep 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@duncangroenewald
Copy link

The documentation doesn't appear to provide any examples of how to execute a prepared statement. The only reference I was able to find was a reference to use a struct but this seems at odds with creating prepared statements on the server and then executing them.

Is there any documentation or examples of executing a prepared statement from the client. The normal await client.query() doesn't appear to work.

@duncangroenewald duncangroenewald added the enhancement New feature or request label Sep 14, 2024
@MahdiBM
Copy link
Contributor

MahdiBM commented Sep 15, 2024

@duncangroenewald You don't need to create the statements manually on the server. PostgresNIO handles that over the wire protocol.

See these links to the implementation and a test, as an example of how to make a prepared-statement query using the PostgresClient.
I haven't taken a proper look at the docs, so can't comment on that. We should add an example if there is no such example in the docs currently.

@duncangroenewald
Copy link
Author

Thanks, I figured it out. Conceptually it is a little confusing at first so an explanation or at least a link to the test examples in the documentation would be a help.

@MahdiBM
Copy link
Contributor

MahdiBM commented Sep 15, 2024

@duncangroenewald we agree that this issue is still valid then 🙂.

@MahdiBM MahdiBM reopened this Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants