Method: Baza::Driver::Sqlite3#escape

Defined in:
lib/baza/driver/sqlite3.rb

#escape(string) ⇒ Object

Escapes a string to be safe to used in a query.



69
70
71
72
73
# File 'lib/baza/driver/sqlite3.rb', line 69

def escape(string)
  # This code is taken directly from the documentation so we dont have to rely on the SQLite3::Database class. This way it can also be used with JRuby and IronRuby...
  # http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html
  string.to_s.gsub(/'/, "''")
end