Sequel doesn't seem to work with IN equality for prepared statements.

The code:

ps = DB[:foo].where([[:id, [:$id]]]).prepare(:select, :select_bulk)
ps.call(id: [1, 2, 3])

With logging switched on, here is what happens:

I, [2016-06-18T15:09:18.071668 #98572]  INFO -- : (0.000409s) SET 
standard_conforming_strings = ON
I, [2016-06-18T15:09:18.072000 #98572]  INFO -- : (0.000196s) SET 
client_min_messages = 'WARNING'
I, [2016-06-18T15:09:18.072179 #98572]  INFO -- : (0.000129s) SET DateStyle 
= 'ISO'
I, [2016-06-18T15:09:18.073650 #98572]  INFO -- : (0.001131s) PREPARE 
select_bulk AS SELECT * FROM "validation" WHERE ("id" IN ($1))
E, [2016-06-18T15:09:18.073924 #98572] ERROR -- : 
PG::InvalidTextRepresentation: ERROR:  invalid input syntax for integer: 
"[1, 2, 3]": EXECUTE select_bulk; [[1, 2, 3]]
/Users/dteoh/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.34.0/lib/sequel/adapters/postgres.rb:531:in
 
`exec_prepared': PG::InvalidTextRepresentation: ERROR:  invalid input 
syntax for integer: "[1, 2, 3]" (Sequel::DatabaseError)

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to