MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / __create_keyspace

Function __create_keyspace

cassandra/cqlengine/management.py:106–114  ·  view source on GitHub ↗
(name, durable_writes, strategy_class, strategy_options, connection=None)

Source from the content-addressed store, hash-verified

104 raise ValueError('Connections must be a list or a tuple.')
105
106 def __create_keyspace(name, durable_writes, strategy_class, strategy_options, connection=None):
107 cluster = get_cluster(connection)
108
109 if name not in cluster.metadata.keyspaces:
110 log.info(format_log_context("Creating keyspace %s", connection=connection), name)
111 ks_meta = metadata.KeyspaceMetadata(name, durable_writes, strategy_class, strategy_options)
112 execute(ks_meta.as_cql_query(), connection=connection)
113 else:
114 log.info(format_log_context("Not creating keyspace %s because it already exists", connection=connection), name)
115
116 if connections:
117 for connection in connections:

Callers 1

_create_keyspaceFunction · 0.85

Calls 4

as_cql_queryMethod · 0.95
get_clusterFunction · 0.90
format_log_contextFunction · 0.90
executeFunction · 0.90

Tested by

no test coverage detected