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

using goqu to create prepared statements #127

Closed
ldelossa opened this issue Aug 12, 2019 · 1 comment
Closed

using goqu to create prepared statements #127

ldelossa opened this issue Aug 12, 2019 · 1 comment

Comments

@ldelossa
Copy link

Hello there,

I am attempting to use Goqu to create a large set of queries. These queries will be selected based on the context of a request. I would also like to "prepare" these queries with the standard sql/db module. For me to do this I need Goqu to actually produce SQL statements with the bind variable placeholders. For example SELECT * FROM table WHERE value = $1.
Is this currently possible or will '$1' always be quoted in the resulting Query?

@doug-martin
Copy link
Owner

Goqu will handle that for you if you use the correct dialect, postgres is currently the only dialect that supports placeholders in that format.

Take a look at:

https://github.com/doug-martin/goqu/blob/master/docs/dialect.md
https://github.com/doug-martin/goqu/blob/master/docs/interpolation.md

Hope this helps.

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

No branches or pull requests

2 participants