Module: ROM::SQL
- Defined in:
- lib/rom/sql.rb,
lib/rom/sql/header.rb,
lib/rom/sql/gateway.rb,
lib/rom/sql/version.rb,
lib/rom/sql/relation.rb,
lib/rom/sql/migration.rb,
lib/rom/sql/commands/create.rb,
lib/rom/sql/commands/delete.rb,
lib/rom/sql/commands/update.rb,
lib/rom/sql/plugin/associates.rb,
lib/rom/sql/plugin/pagination.rb,
lib/rom/sql/migration/migrator.rb,
lib/rom/sql/relation/inspection.rb,
lib/rom/sql/commands/transaction.rb,
lib/rom/sql/commands_ext/postgres.rb,
lib/rom/sql/relation/associations.rb,
lib/rom/sql/commands/error_wrapper.rb,
lib/rom/sql/relation/class_methods.rb,
lib/rom/sql/support/rails_log_subscriber.rb
Defined Under Namespace
Modules: Commands, Migration, Plugin Classes: Error, Gateway, Header, RailsLogSubscriber, Relation
Constant Summary collapse
- NoAssociationError =
Class.new(StandardError)
- DatabaseError =
Class.new(Error)
- ConstraintError =
Class.new(Error)
- NotNullConstraintError =
Class.new(ConstraintError)
- UniqueConstraintError =
Class.new(ConstraintError)
- ForeignKeyConstraintError =
Class.new(ConstraintError)
- CheckConstraintError =
Class.new(ConstraintError)
- ERROR_MAP =
{ Sequel::DatabaseError => DatabaseError, Sequel::NotNullConstraintViolation => NotNullConstraintError, Sequel::UniqueConstraintViolation => UniqueConstraintError, Sequel::ForeignKeyConstraintViolation => ForeignKeyConstraintError, Sequel::CheckConstraintViolation => CheckConstraintError }.freeze
- VERSION =
'0.5.2'.freeze
- Rollback =
Class.new(Sequel::Rollback)
Class Method Summary collapse
-
.gateway ⇒ Object
private
Return first sql gateway for migrations.
-
.migration(gateway = :default, &block) ⇒ Object
Create a database migration for a specific gateway.
Class Method Details
.gateway ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return first sql gateway for migrations
This is used by migration tasks, they only support a single sql gateway
40 41 42 43 44 |
# File 'lib/rom/sql/migration.rb', line 40 def self.gateway ROM.gateways .keys .detect { |gateway| gateway.instance_of?(Gateway) } end |