Sha256: 883e99403c65601b8c1ef3705c0b21110ed8b6b6d4be1b33fe8d7c89d58ea1dc

Contents?: true

Size: 575 Bytes

Versions: 31

Compression:

Stored size: 575 Bytes

Contents

require "directive_record/query/sql"
require "directive_record/query/mysql"
require "directive_record/query/big_query"

module DirectiveRecord
  module Query

    def self.new(klass, connection = nil)
      class_for((connection || klass.connection).class.name.downcase).new(klass)
    end

  private

    def self.class_for(connection_class)
      if connection_class.include?("mysql")
        MySQL
      elsif connection_class.include?("bigquery")
        BigQuery
      else
        raise NotImplementedError, "Connection type not supported"
      end
    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
directiverecord-0.1.32 lib/directive_record/query.rb
directiverecord-0.1.31 lib/directive_record/query.rb
directiverecord-0.1.30 lib/directive_record/query.rb
directiverecord-0.1.29 lib/directive_record/query.rb
directiverecord-0.1.28 lib/directive_record/query.rb
directiverecord-0.1.27 lib/directive_record/query.rb
directiverecord-0.1.26 lib/directive_record/query.rb
directiverecord-0.1.25 lib/directive_record/query.rb
directiverecord-0.1.24 lib/directive_record/query.rb
directiverecord-0.1.23 lib/directive_record/query.rb
directiverecord-0.1.22 lib/directive_record/query.rb
directiverecord-0.1.21 lib/directive_record/query.rb
directiverecord-0.1.20 lib/directive_record/query.rb
directiverecord-0.1.19 lib/directive_record/query.rb
directiverecord-0.1.18 lib/directive_record/query.rb
directiverecord-0.1.17 lib/directive_record/query.rb
directiverecord-0.1.16 lib/directive_record/query.rb
directiverecord-0.1.15 lib/directive_record/query.rb
directiverecord-0.1.14 lib/directive_record/query.rb
directiverecord-0.1.13 lib/directive_record/query.rb