jmoiron / sqlx

general purpose extensions to golang's database/sql
http://jmoiron.github.io/sqlx/
MIT License
16.32k stars 1.09k forks source link

got XX parameters but the statement requires YY - potential BUG in v1.3.5 #870

Open Abhimanyuaj001 opened 1 year ago

Abhimanyuaj001 commented 1 year ago

Hello,

Tried with NamedExec and NamedExecContext while passing one map at a time as arg it works fine but If I tried it with an array of maps it's giving this type of error pq: got XX parameters but the statement requires YY.

with cte as ( INSERT INTO people (id,first_name,last_name,email,orphan,modified_date) VALUES (:id,:first_name,:last_name,:email,:orphan,NOW()) returning gid ) INSERT INTO relation(identity_id,native_id,instance_gid,native_manager_id) SELECT gid,:native_id,:instance_gid,:native_manager_id from cte

Regards, Abhimanyu