sqlingo
sqlingo copied to clipboard
support prepared arguments
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!
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?
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.