Class: Lynx::DSL
- Inherits:
-
Object
- Object
- Lynx::DSL
- Defined in:
- lib/lynx/d_s_l.rb
Instance Method Summary collapse
- #basic ⇒ Object
- #create_database ⇒ Object
- #create_database_if_not_exists ⇒ Object
- #data ⇒ Object
- #drop_database ⇒ Object
- #drop_database_if_exists ⇒ Object
- #dump ⇒ Object
-
#initialize(config) ⇒ DSL
constructor
A new instance of DSL.
- #select ⇒ Object
- #structure ⇒ Object
Constructor Details
Instance Method Details
#basic ⇒ Object
10 11 12 13 14 15 |
# File 'lib/lynx/d_s_l.rb', line 10 def basic Command::Basic.new(@config) .mysql . .with_database end |
#create_database ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lynx/d_s_l.rb', line 17 def create_database Command::Basic.new(@config) .mysql . .sql("create database #{@config.database}") end |
#create_database_if_not_exists ⇒ Object
24 25 26 27 28 29 |
# File 'lib/lynx/d_s_l.rb', line 24 def create_database_if_not_exists Command::Basic.new(@config) .mysql . .sql("create database if not exists #{@config.database}") end |
#data ⇒ Object
55 56 57 |
# File 'lib/lynx/d_s_l.rb', line 55 def data dump.no_create_info end |
#drop_database ⇒ Object
31 32 33 34 35 36 |
# File 'lib/lynx/d_s_l.rb', line 31 def drop_database Command::Basic.new(@config) .mysql . .sql("drop database #{@config.database}") end |
#drop_database_if_exists ⇒ Object
38 39 40 41 42 43 |
# File 'lib/lynx/d_s_l.rb', line 38 def drop_database_if_exists Command::Basic.new(@config) .mysql . .sql("drop database if exists #{@config.database}") end |
#dump ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/lynx/d_s_l.rb', line 45 def dump Command::Dump.new(@config) . .with_database .skip_quote_names .compress .compact .no_create_db end |
#select ⇒ Object
63 64 65 66 67 68 |
# File 'lib/lynx/d_s_l.rb', line 63 def select basic .batch .no_names .compress end |
#structure ⇒ Object
59 60 61 |
# File 'lib/lynx/d_s_l.rb', line 59 def structure dump.no_data end |