class Believer::KeySpace
Constants
- DEFAULT_PROPERTIES
Public Class Methods
new(environment)
click to toggle source
# File lib/believer/key_space.rb, line 7 def initialize(environment) @environment = environment end
Public Instance Methods
create(properties = {})
click to toggle source
# File lib/believer/key_space.rb, line 21 def create(properties = {}) conn = @environment.create_connection(:connect_to_keyspace => false) ks_props = DEFAULT_PROPERTIES.merge(properties) ks_props_s = to_cql_properties(ks_props) ks_def = "CREATE KEYSPACE #{name} WITH #{ks_props_s}" conn.execute(ks_def) end
drop()
click to toggle source
# File lib/believer/key_space.rb, line 15 def drop connection = @environment.create_connection(:connect_to_keyspace => false) connection.execute("DROP KEYSPACE #{name}") connection.close end
name()
click to toggle source
# File lib/believer/key_space.rb, line 11 def name @environment.connection_configuration[:keyspace] end