Module: ActiveRecord::ConnectionAdapters::Hanaclient::Quoting

Included in:
ActiveRecord::ConnectionAdapters::HanaclientAdapter
Defined in:
lib/active_record/connection_adapters/hanaclient/quoting.rb

Instance Method Summary collapse

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::.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_falseObject



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_trueObject



12
13
14
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 12

def quoted_true
  "true".freeze
end

#unquoted_falseObject



24
25
26
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 24

def unquoted_false
  "false".freeze
end

#unquoted_trueObject



16
17
18
# File 'lib/active_record/connection_adapters/hanaclient/quoting.rb', line 16

def unquoted_true
  "true".freeze
end