I'd like to execute the following sort of query through sqlite3-ruby:
SELECT * FROM foo WHERE bar IN (:items)
and bind :items
to one or many literals. Is this possible? The obvious technique of passing the list of literals as an array as follows doesn't seem to work:
db.execute("SELECT * FROM foo WHERE bar IN (:items)", :items=>[3,1])
(In the above example, only the first value in the array is bound to :items
.)