Module: ActiveRecord::ConnectionAdapters::SQLite3::Quoting

Included in:
ActiveRecord::ConnectionAdapters::SQLite3Adapter
Defined in:
lib/active_record/connection_adapters/sqlite3/quoting.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#quote_column_name(name) ⇒ Object


15
16
17
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 15

def quote_column_name(name)
  @quoted_column_names[name] ||= %Q("#{super.gsub('"', '""')}").freeze
end

#quote_string(s) ⇒ Object


7
8
9
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 7

def quote_string(s)
  @connection.class.quote(s)
end

#quote_table_name_for_assignment(table, attr) ⇒ Object


11
12
13
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 11

def quote_table_name_for_assignment(table, attr)
  quote_column_name(attr)
end

#quoted_binary(value) ⇒ Object


23
24
25
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 23

def quoted_binary(value)
  "x'#{value.hex}'"
end

#quoted_falseObject


35
36
37
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 35

def quoted_false
  ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer ? "0".freeze : "'f'".freeze
end

#quoted_time(value) ⇒ Object


19
20
21
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 19

def quoted_time(value)
  quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "2000-01-01 ")
end

#quoted_trueObject


27
28
29
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 27

def quoted_true
  ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer ? "1".freeze : "'t'".freeze
end

#unquoted_falseObject


39
40
41
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 39

def unquoted_false
  ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer ? 0 : "f".freeze
end

#unquoted_trueObject


31
32
33
# File 'lib/active_record/connection_adapters/sqlite3/quoting.rb', line 31

def unquoted_true
  ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer ? 1 : "t".freeze
end