Class: Swift::Adapter::Postgres
- Inherits:
-
Sql
show all
- Defined in:
- lib/swift/adapter/postgres.rb
Constant Summary
EM
Instance Attribute Summary
#db
Instance Method Summary
collapse
Methods inherited from Sql
#fields, #transaction
#migrate!
#create, #delete, #execute, #get, #identity_map, #log_command, #prepare, #trace, #trace?, #update
Constructor Details
#initialize(options = {}) ⇒ Postgres
Returns a new instance of Postgres.
7
8
9
|
# File 'lib/swift/adapter/postgres.rb', line 7
def initialize options = {}
super Swift::DB::Postgres.new(options)
end
|
Instance Method Details
#field_type(attribute) ⇒ Object
15
16
17
18
19
20
|
# File 'lib/swift/adapter/postgres.rb', line 15
def field_type attribute
case attribute
when Type::IO then 'bytea'
else super
end
end
|
#returning? ⇒ Boolean
11
12
13
|
# File 'lib/swift/adapter/postgres.rb', line 11
def returning?
true
end
|
#tables ⇒ Object
22
23
24
|
# File 'lib/swift/adapter/postgres.rb', line 22
def tables
execute('select tablename from pg_tables where schemaname = current_schema').map(&:values).flatten
end
|