Module: Timescaledb::Database::Quoting

Included in:
Timescaledb::Database
Defined in:
lib/timescaledb/database/quoting.rb

Instance Method Summary collapse

Instance Method Details

#quote(value) ⇒ String

Quotes given value and escapes single quote and backslash characters.

Returns:

  • (String)

    The given value between quotes



7
8
9
# File 'lib/timescaledb/database/quoting.rb', line 7

def quote(value)
  "'#{value.gsub("\\", '\&\&').gsub("'", "''")}'"
end