Class: PG::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/pglite/pg.rb

Class Method Summary collapse

Class Method Details

.conndefaults_hashObject

TODO: can we support some configuration?



29
# File 'lib/pglite/pg.rb', line 29

def conndefaults_hash = {}

.quote_ident(str) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/pglite/pg.rb', line 31

def quote_ident(str)
  str = str.to_s
  return '""' if str.empty?
  if str =~ /[^a-zA-Z_0-9]/ || str =~ /^[0-9]/
    '"' + str.gsub('"', '""') + '"'
  else
    str
  end
end