If I understand the Sequel documentation correctly, using String#lit
or Sequel.lit
should turn a Ruby string into a literal string and bypass the automatic escaping mechanism; therefore, this should work (untested):
@values='stuff1\'','stuff2\''.lit
db.fetch("query...where IN (?)", "#{@values}")
The usual caveats when working with raw SQL strings (SQL injection attacks, inefficient SQL due to forced re-parsing of statements etc.) apply :-)