Class: MysqlRewinder::Cleaner::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/mysql_rewinder/cleaner/adapter.rb

Direct Known Subclasses

Mysql2Adapter, TrilogyAdapter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_config) ⇒ Adapter

Returns a new instance of Adapter.



21
# File 'lib/mysql_rewinder/cleaner/adapter.rb', line 21

def initialize(_config); end

Class Method Details

.generate(adapter, config) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mysql_rewinder/cleaner/adapter.rb', line 4

def self.generate(adapter, config)
  case adapter
  when :trilogy
    require 'trilogy'
    require_relative '../ext/trilogy'

    TrilogyAdapter.new(config)
  when :mysql2
    require 'mysql2'
    require_relative '../ext/mysql2_client'

    Mysql2Adapter.new(config)
  else
    raise 'adapter must be either :trilogy or :mysql2'
  end
end

Instance Method Details

#execute(sql) ⇒ Object

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/mysql_rewinder/cleaner/adapter.rb', line 27

def execute(sql)
  raise NotImplementedError
end

#query(sql) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/mysql_rewinder/cleaner/adapter.rb', line 23

def query(sql)
  raise NotImplementedError
end