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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/exwiw/adapter.rb', line 68

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)


52
53
54
# File 'lib/exwiw/adapter.rb', line 52

def execute(query_ast)
  raise NotImplementedError
end

#to_bulk_delete(select_query_ast, table) ⇒ Object

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/exwiw/adapter.rb', line 64

def to_bulk_delete(select_query_ast, table)
  raise NotImplementedError
end

#to_bulk_insert(results, table) ⇒ Object

Raises:

  • (NotImplementedError)


58
59
60
# File 'lib/exwiw/adapter.rb', line 58

def to_bulk_insert(results, table)
  raise NotImplementedError
end