Method: SQLite3::Database.quote

Defined in:
lib/sqlite3/database.rb

.quote(string) ⇒ Object

Quotes the given string, making it safe to use in an SQL statement. It replaces all instances of the single-quote character with two single-quote characters. The modified string is returned.



67
68
69
# File 'lib/sqlite3/database.rb', line 67

def quote(string)
  string.gsub("'", "''")
end