Class: DNApi::DbStack
Constant Summary
collapse
- Mysql =
new(
:name => 'mysql',
:label => 'MySQL 5.0.x',
:supports_replication => true,
:backup_command => 'eybackup --quiet',
:adapter => 'mysql'
)
- Mysql5_1 =
new(
:name => 'mysql5_1',
:label => 'MySQL 5.1.x',
:supports_replication => true,
:backup_command => 'eybackup -e mysql --quiet',
:adapter => 'mysql'
)
- Mysql5_5 =
new(
:name => 'mysql5_5',
:label => 'MySQL 5.5.x (Beta)',
:supports_replication => true,
:backup_command => 'eybackup -e mysql --quiet',
:adapter => 'mysql'
)
- Postgres =
new(
:name => 'postgres',
:label => 'PostgreSQL 8.3.x',
:supports_replication => false,
:backup_command => 'eybackup -e postgresql --quiet',
:adapter => 'postgresql'
)
- Postgres9 =
new(
:name => 'postgres9',
:label => 'PostgreSQL 9.0.x',
:supports_replication => true,
:backup_command => 'eybackup -e postgresql --quiet',
:adapter => 'postgresql'
)
- Postgres91 =
new(
:name => 'postgres9_1',
:label => 'PostgreSQL 9.1.x',
:supports_replication => true,
:backup_command => 'eybackup -e postgresql --quiet',
:adapter => 'postgresql'
)
- NoDB =
new(
:name => 'no_db',
:label => 'No Database',
:supports_replication => false,
:backup_command => 'echo',
:adapter => 'none'
)
Instance Attribute Summary collapse
Attributes inherited from Struct
#parent
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Struct
#==, _many, #_many, #_many_values, _ones, #_ones, #_ones_values, _umembers, belongs_to, from, #initialize, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member
Methods included from Test::Ext
#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick
Constructor Details
This class inherits a constructor from DNApi::Struct
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter
2
3
4
|
# File 'lib/dnapi/db_stack.rb', line 2
def adapter
@adapter
end
|
#backup_command ⇒ Object
Returns the value of attribute backup_command
2
3
4
|
# File 'lib/dnapi/db_stack.rb', line 2
def backup_command
@backup_command
end
|
#label ⇒ Object
Returns the value of attribute label
2
3
4
|
# File 'lib/dnapi/db_stack.rb', line 2
def label
@label
end
|
#name ⇒ Object
Returns the value of attribute name
2
3
4
|
# File 'lib/dnapi/db_stack.rb', line 2
def name
@name
end
|
#supports_replication ⇒ Object
Returns the value of attribute supports_replication
2
3
4
|
# File 'lib/dnapi/db_stack.rb', line 2
def supports_replication
@supports_replication
end
|
Class Method Details
.get(name) ⇒ Object
59
60
61
|
# File 'lib/dnapi/db_stack.rb', line 59
def self.get(name)
all.detect {|s| s.name == name }
end
|
Instance Method Details
#adapter_for(component) ⇒ Object
95
96
97
98
99
100
101
|
# File 'lib/dnapi/db_stack.rb', line 95
def adapter_for(component)
if adapter == 'mysql' && DNApi::Components::RubyVersion.encoding_aware.include?(component.class)
'mysql2'
else
adapter
end
end
|
#mysql5_1? ⇒ Boolean
83
84
85
|
# File 'lib/dnapi/db_stack.rb', line 83
def mysql5_1?
name == 'mysql5_1'
end
|
#mysql5_5? ⇒ Boolean
87
88
89
|
# File 'lib/dnapi/db_stack.rb', line 87
def mysql5_5?
name == 'mysql5_5'
end
|
#mysql? ⇒ Boolean
91
92
93
|
# File 'lib/dnapi/db_stack.rb', line 91
def mysql?
name == 'mysql'
end
|
#no_db? ⇒ Boolean
67
68
69
|
# File 'lib/dnapi/db_stack.rb', line 67
def no_db?
name == 'no_db'
end
|
#postgres9? ⇒ Boolean
75
76
77
|
# File 'lib/dnapi/db_stack.rb', line 75
def postgres9?
name == 'postgres9'
end
|
#postgres9_1? ⇒ Boolean
79
80
81
|
# File 'lib/dnapi/db_stack.rb', line 79
def postgres9_1?
name == 'postgres9_1'
end
|
#postgres? ⇒ Boolean
71
72
73
|
# File 'lib/dnapi/db_stack.rb', line 71
def postgres?
name == 'postgres'
end
|
#supports_replication? ⇒ Boolean
63
64
65
|
# File 'lib/dnapi/db_stack.rb', line 63
def supports_replication?
supports_replication
end
|