Skip to content
New issue

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

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

Already on GitHub? # to your account

support prepared arguments #16

Open
canuran opened this issue May 30, 2023 · 2 comments
Open

support prepared arguments #16

canuran opened this issue May 30, 2023 · 2 comments

Comments

@canuran
Copy link

canuran commented May 30, 2023

SELECT ...... WHERE "Order"."id" in (1,2,3) AND ("Order"."name" LIKE 'Can%' OR "Order"."price" > 15)

to

SELECT ...... WHERE "Order"."id" in (?,?,?) AND ("Order"."name" LIKE ? OR "Order"."price" > ?)

By the way, this is a very good project!

@lqs
Copy link
Owner

lqs commented May 30, 2023

It's good to use prepared statements to improve performance, but the problem is with the "in" clause that requires the exact number of placeholders in the prepared statement. This leads to different prepared statements for various counts in the list. Any suggestions?

@canuran
Copy link
Author

canuran commented May 31, 2023

It's good to use prepared statements to improve performance, but the problem is with the "in" clause that requires the exact number of placeholders in the prepared statement. This leads to different prepared statements for various counts in the list. Any suggestions?

Not just for performance but also for safety.
The number of parameters is fixed when executing.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants