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



92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/exwiw/adapter.rb', line 92

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)


76
77
78
# File 'lib/exwiw/adapter.rb', line 76

def execute(query_ast)
  raise NotImplementedError
end

#to_bulk_delete(select_query_ast, table) ⇒ Object

Raises:

  • (NotImplementedError)


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

def to_bulk_delete(select_query_ast, table)
  raise NotImplementedError
end

#to_bulk_insert(results, table) ⇒ Object

Raises:

  • (NotImplementedError)


82
83
84
# File 'lib/exwiw/adapter.rb', line 82

def to_bulk_insert(results, table)
  raise NotImplementedError
end