sqlingo icon indicating copy to clipboard operation
sqlingo copied to clipboard

support prepared arguments

Open canuran opened this issue 1 year ago • 2 comments

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!

canuran avatar May 30 '23 06:05 canuran

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?

lqs avatar May 30 '23 07:05 lqs

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.

canuran avatar May 31 '23 07:05 canuran