You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the readme there doesn't seem to be a consensus as to what character should the parameter placeholder on prepared queries be. Some examples use ? while some examples use $1, $2, $3, .... Let`s enumerate them by section:
Quickstart
SELECT $1
Querying
SELECT * FROM users WHERE email = ?
SELECT * FROM users WHERE email = ? OR name = ?
Compile-time verification
SELECT country, COUNT(*) as count FROM users GROUP BY country WHERE organization = ?
I'm using v0.4.2 and tried following these examples, and although it did compile the generated queries did not substitute the parameter placeholder for the bound value when using ?. It only worked (both when query and query_as as well as the macros) when using the $1 placeholders.
I'd be happy to submit a PR correcting the examples as soon as the correct usage is established.
The text was updated successfully, but these errors were encountered:
It should be made more clear in the README but currently we do not make any changes to the SQL statement that you write. This means you must use the parameter syntax that is appropriate for your database:
In the readme there doesn't seem to be a consensus as to what character should the parameter placeholder on prepared queries be. Some examples use
?
while some examples use$1, $2, $3, ...
. Let`s enumerate them by section:Quickstart
SELECT $1
Querying
SELECT * FROM users WHERE email = ?
SELECT * FROM users WHERE email = ? OR name = ?
Compile-time verification
SELECT country, COUNT(*) as count FROM users GROUP BY country WHERE organization = ?
I'm using v0.4.2 and tried following these examples, and although it did compile the generated queries did not substitute the parameter placeholder for the bound value when using
?
. It only worked (both whenquery
andquery_as
as well as the macros) when using the$1
placeholders.I'd be happy to submit a PR correcting the examples as soon as the correct usage is established.
The text was updated successfully, but these errors were encountered: