3 ms·
I'm not sure I would classify a sql client library that doesn't support arrays as "sane". This may have been annoying in the past, I would expect modern librari
by pdkl95 7y ago
I'm not sure I would classify a sql client library that doesn't support arrays as "sane". This may have been annoying in the past, I would expect modern libraries to handle basic features like 'IN" automagically.
list = ['bar', 'baz', "Robert'); DROP TABLE Students;--"]
Foo.where(name: list)
# Foo Load (0.3ms)
# SELECT "foo".* FROM "foo"
# WHERE "foo"."name" IN (?, ?, ?)
# [["name", "bar"],
# ["name", "baz"],
# ["name", "Robert'); DROP TABLE Students;--"]]