Class: Swift::Adapter::Postgres
- Inherits:
-
Sql
- Object
- Swift::Adapter
- Sql
- Swift::Adapter::Postgres
- Defined in:
- lib/swift/adapter/postgres.rb
Instance Attribute Summary
Attributes inherited from Swift::Adapter
Instance Method Summary collapse
- #field_type(attribute) ⇒ Object
-
#initialize(options = {}) ⇒ Postgres
constructor
A new instance of Postgres.
- #returning? ⇒ Boolean
- #tables ⇒ Object
Methods inherited from Sql
#fields, #serialized_transaction, #transaction
Methods included from Migrations::InstanceMethods
Methods inherited from Swift::Adapter
#aexecute, #blocking_execute, #create, #delete, #execute, #get, #identity_map, #log_command, #pending, #prepare, #trace, #trace?, #update
Constructor Details
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 |