cassandra.cqlengine.connection
- Connection management for cqlengine
Functions
default
()Configures the default connection to localhost, using the driver defaults (except for row_factory)
set_session
(s)Configures the default connection with a preexisting cassandra.cluster.Session
Note: the mapper presently requires a Session row_factory
set to dict_factory
.
This may be relaxed in the future
setup
(hosts, default_keyspace, consistency=None, lazy_connect=False, retry_connect=False, **kwargs)Setup a the driver connection used by the mapper
- Parameters
-
-
hosts (list) – list of hosts, (
contact_points
forcassandra.cluster.Cluster
) -
default_keyspace (str) – The default keyspace to use
-
consistency (int) – The global default
ConsistencyLevel
- default is the same asSession.default_consistency_level
-
lazy_connect (bool) – True if should not connect until first use
-
retry_connect (bool) – True if we should retry to connect even if there was a connection failure initially
-
**kwargs – Pass-through keyword arguments for
cassandra.cluster.Cluster
-