Class: Swift::DB::Postgres

Inherits:
Adapter
  • Object
show all
Defined in:
lib/swift/db.rb

Overview

Mysql

Instance Attribute Summary

Attributes inherited from Adapter

#options

Instance Method Summary collapse

Methods inherited from Adapter

#all, #begin, #clone, #close, #commit, #create, #destroy, #drop_store, #dup, #escape, #execute, #first, #get, #identity_map, #migrate!, #prepare, #results, #rollback, #transaction, #update, #write

Constructor Details

#initialize(options = {}) ⇒ Postgres

Returns a new instance of Postgres.



14
15
16
# File 'lib/swift/db.rb', line 14

def initialize options = {}
  super options.update(driver: 'postgresql')
end

Instance Method Details

#field_type(attribute) ⇒ Object



22
23
24
25
26
27
# File 'lib/swift/db.rb', line 22

def field_type attribute
  case attribute
    when Type::IO then 'bytea'
    else super
  end
end

#returning?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/swift/db.rb', line 18

def returning?
  true
end