Module: ActiveRecord::ConnectionAdapters::Hanaclient::Quoting
- Included in:
- ActiveRecord::ConnectionAdapters::HanaclientAdapter
- Defined in:
- lib/active_record/connection_adapters/hanaclient/quoting.rb
Instance Method Summary collapse
- #fetch_type_metadata(sql_type) ⇒ Object
-
#quote_column_name(name) ⇒ Object
Replaces any “ symbols with ”“.
- #quote_table_name(name) ⇒ Object
- #quote_table_name_for_assignment(table, attr) ⇒ Object
- #quoted_false ⇒ Object
-
#quoted_time(value) ⇒ Object
Gets the time from a date string.
- #quoted_true ⇒ Object
- #unquoted_false ⇒ Object
- #unquoted_true ⇒ Object
Instance Method Details
#fetch_type_metadata(sql_type) ⇒ Object
41 42 43 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 41 def (sql_type) Hanaclient::TypeMetadata.new(super(sql_type)) end |
#quote_column_name(name) ⇒ Object
Replaces any “ symbols with ”“
7 8 9 10 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 7 def quote_column_name(name) @quoted_column_names = @quoted_column_names || {} @quoted_column_names[name] ||= %Q("#{super.gsub('"', '""')}").freeze end |
#quote_table_name(name) ⇒ Object
32 33 34 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 32 def quote_table_name name name.to_s end |
#quote_table_name_for_assignment(table, attr) ⇒ Object
28 29 30 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 28 def quote_table_name_for_assignment(table, attr) quote_column_name(attr) end |
#quoted_false ⇒ Object
20 21 22 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 20 def quoted_false "false".freeze end |
#quoted_time(value) ⇒ Object
Gets the time from a date string
37 38 39 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 37 def quoted_time(value) quoted_date(value).match(/[0-2][0-9]:[0-9][0-9]:[0-9][0-9]/)[0] end |
#quoted_true ⇒ Object
12 13 14 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 12 def quoted_true "true".freeze end |
#unquoted_false ⇒ Object
24 25 26 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 24 def unquoted_false "false".freeze end |
#unquoted_true ⇒ Object
16 17 18 |
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 16 def unquoted_true "true".freeze end |