Class: MysqlFramework::Scripts::Base
- Inherits:
-
Object
- Object
- MysqlFramework::Scripts::Base
- Defined in:
- lib/mysql_framework/scripts/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #apply(_client) ⇒ Object
- #identifier ⇒ Object
- #rollback(_client) ⇒ Object
- #tags ⇒ Object
- #update_procedure(client, proc_name, proc_file) ⇒ Object
Class Method Details
.descendants ⇒ Object
19 20 21 |
# File 'lib/mysql_framework/scripts/base.rb', line 19 def self.descendants ObjectSpace.each_object(Class).select { |klass| klass < self } end |
Instance Method Details
#apply(_client) ⇒ Object
11 12 13 |
# File 'lib/mysql_framework/scripts/base.rb', line 11 def apply(_client) raise NotImplementedError end |
#identifier ⇒ Object
6 7 8 9 |
# File 'lib/mysql_framework/scripts/base.rb', line 6 def identifier raise NotImplementedError if @identifier.nil? @identifier end |
#rollback(_client) ⇒ Object
15 16 17 |
# File 'lib/mysql_framework/scripts/base.rb', line 15 def rollback(_client) raise NotImplementedError end |
#tags ⇒ Object
23 24 25 |
# File 'lib/mysql_framework/scripts/base.rb', line 23 def [] end |
#update_procedure(client, proc_name, proc_file) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/mysql_framework/scripts/base.rb', line 27 def update_procedure(client, proc_name, proc_file) client.query(<<~SQL) DROP PROCEDURE IF EXISTS #{proc_name}; SQL proc_sql = File.read(proc_file) client.query(proc_sql) end |