Class: DbAgile::SequelAdapter
- Extended by:
- ClassMethods
- Includes:
- Connection, Data::TableDriven, Data::TransactionDriven, Schema::TableDriven, Schema::TransactionDriven
- Defined in:
- lib/dbagile/adapter/sequel.rb,
lib/dbagile/adapter/sequel/connection.rb,
lib/dbagile/adapter/sequel/class_methods.rb,
lib/dbagile/adapter/sequel/sequel_tracer.rb,
lib/dbagile/adapter/sequel/data/table_driven.rb,
lib/dbagile/adapter/sequel/schema/table_driven.rb,
lib/dbagile/adapter/sequel/schema/physical_dump.rb,
lib/dbagile/adapter/sequel/schema/concrete_script.rb,
lib/dbagile/adapter/sequel/data/transaction_driven.rb,
lib/dbagile/adapter/sequel/schema/schema2sequel_args.rb,
lib/dbagile/adapter/sequel/schema/transaction_driven.rb
Overview
Implements the Adapter contract using Sequel.
Defined Under Namespace
Modules: ClassMethods, Connection, Data, Schema Classes: SequelTracer
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Connection options.
-
#uri ⇒ Object
readonly
Underlying database URI.
Instance Method Summary collapse
-
#db ⇒ Object
Returns the underlying Sequel::Database instance.
-
#initialize(uri, options = {}) ⇒ SequelAdapter
constructor
Creates an adapter with a given uri.
Methods included from ClassMethods
Methods included from Schema::TransactionDriven
#add_columns, #create_table, #drop_table, #key!, #run_schema_script
Methods included from Schema::TableDriven
#column_names, #dbtype_to_ruby_type, #has_table?, #heading, #keys
Methods included from Data::TransactionDriven
#delete, #direct_sql, #insert, #update
Methods included from Data::TableDriven
Methods included from Connection
#disconnect, #physical_schema, #ping, #script2sql, #transaction
Methods inherited from Adapter
Methods included from Contract::Schema::TransactionDriven
#add_columns, #create_table, #drop_table, #key!
Methods included from Contract::Schema::TableDriven
#column_names, #has_column?, #has_table?, #heading, #is_key?, #keys
Methods included from Contract::Data::TransactionDriven
#delete, #direct_sql, #insert, #update
Methods included from Contract::Data::TableDriven
Methods included from Contract::Connection
#disconnect, #physical_schema, #ping, #ping?, #script2sql, #transaction
Methods included from Contract::Robust::Helpers
Constructor Details
#initialize(uri, options = {}) ⇒ SequelAdapter
Creates an adapter with a given uri
31 32 33 |
# File 'lib/dbagile/adapter/sequel.rb', line 31 def initialize(uri, = {}) @uri, @options = uri, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Connection options
28 29 30 |
# File 'lib/dbagile/adapter/sequel.rb', line 28 def @options end |
#uri ⇒ Object (readonly)
Underlying database URI
25 26 27 |
# File 'lib/dbagile/adapter/sequel.rb', line 25 def uri @uri end |
Instance Method Details
#db ⇒ Object
Returns the underlying Sequel::Database instance
36 37 38 39 40 41 42 |
# File 'lib/dbagile/adapter/sequel.rb', line 36 def db unless @db @db = ::Sequel.connect(uri) @db.logger = @options[:sequel_logger] end @db end |