Class: Sq::Dbsync::Database::Connection
- Inherits:
-
Object
- Object
- Sq::Dbsync::Database::Connection
- Defined in:
- lib/sq/dbsync/database/connection.rb
Overview
Factory class to abstract selection of a decorator to faciliate databases other than MySQL.
Class Method Summary collapse
Class Method Details
.create(opts, direction) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sq/dbsync/database/connection.rb', line 12 def self.create(opts, direction) case opts[:brand] when 'mysql' Sq::Dbsync::Database::Mysql.new(opts, direction) when 'postgresql' Sq::Dbsync::Database::Postgres.new(opts, direction) else raise "Unsupported database: #{opts.inspect}" end end |