Module: Exwiw::Adapter

Defined in:
lib/exwiw/adapter.rb,
lib/exwiw/adapter/mysql2_adapter.rb,
lib/exwiw/adapter/mongodb_adapter.rb,
lib/exwiw/adapter/sqlite3_adapter.rb,
lib/exwiw/adapter/postgresql_adapter.rb

Defined Under Namespace

Classes: Base, MongodbAdapter, Mysql2Adapter, PostgresqlAdapter, Sqlite3Adapter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(connection_config, logger) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/exwiw/adapter.rb', line 103

def self.build(connection_config, logger)
  case connection_config.adapter
  when 'sqlite3'
    Adapter::Sqlite3Adapter.new(connection_config, logger)
  when 'mysql2'
    Adapter::Mysql2Adapter.new(connection_config, logger)
  when 'postgresql'
    Adapter::PostgresqlAdapter.new(connection_config, logger)
  when 'mongodb'
    Adapter::MongodbAdapter.new(connection_config, logger)
  else
    raise 'Unsupported adapter'
  end
end

Instance Method Details

#execute(query_ast) ⇒ Object

Raises:

  • (NotImplementedError)


87
88
89
# File 'lib/exwiw/adapter.rb', line 87

def execute(query_ast)
  raise NotImplementedError
end

#to_bulk_delete(select_query_ast, table) ⇒ Object

Raises:

  • (NotImplementedError)


99
100
101
# File 'lib/exwiw/adapter.rb', line 99

def to_bulk_delete(select_query_ast, table)
  raise NotImplementedError
end

#to_bulk_insert(results, table) ⇒ Object

Raises:

  • (NotImplementedError)


93
94
95
# File 'lib/exwiw/adapter.rb', line 93

def to_bulk_insert(results, table)
  raise NotImplementedError
end