Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
cassandra.cqlengine.connection - Connection management for cqlengine
Caution
You're viewing documentation for a deprecated version of Scylla Python Driver. Switch to the latest stable version.
cassandra.cqlengine.connection - Connection management for cqlengine¶Configures the default connection to localhost, using the driver defaults (except for row_factory)
Configures the default connection with a preexisting cassandra.cluster.Session
Note: the mapper presently requires a Session cassandra.cluster.Session.row_factory set to dict_factory.
This may be relaxed in the future
Setup the driver connection used by the mapper
hosts (list) – list of hosts, (contact_points for cassandra.cluster.Cluster)
default_keyspace (str) – The default keyspace to use
consistency (int) – The global default ConsistencyLevel - default is the same as Session.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
Add a connection to the connection registry. hosts and session are
mutually exclusive, and consistency, lazy_connect,
retry_connect, and cluster_options only work with hosts. Using
hosts will create a new cassandra.cluster.Cluster and
cassandra.cluster.Session.
hosts (list) – list of hosts, (contact_points for cassandra.cluster.Cluster).
consistency (int) – The default ConsistencyLevel for the
registered connection’s new session. Default is the same as
Session.default_consistency_level. For use with hosts only;
will fail when used with session.
lazy_connect (bool) – True if should not connect until first use. For
use with hosts only; will fail when used with session.
retry_connect (bool) – True if we should retry to connect even if there
was a connection failure initially. For use with hosts only; will
fail when used with session.
cluster_options (dict) – A dict of options to be used as keyword
arguments to cassandra.cluster.Cluster. For use with hosts
only; will fail when used with session.
default (bool) – If True, set the new connection as the cqlengine default
session (Session) – A cassandra.cluster.Session to be used in
the created connection.
Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
cassandra - Exceptions and Enumscassandra.cluster - Clusters and Sessionscassandra.policies - Load balancing and Failure Handling Policiescassandra.auth - Authenticationcassandra.graph - Graph Statements, Options, and Row Factoriescassandra.metadata - Schema and Ring Topologycassandra.metrics - Performance Metricscassandra.query - Prepared Statements, Batch Statements, Tracing, and Row Factoriescassandra.pool - Hosts and Connection Poolscassandra.protocol - Protocol Featurescassandra.encoder - Encoders for non-prepared Statementscassandra.decoder - Data Return Formatscassandra.concurrent - Utilities for Concurrent Statement Executioncassandra.connection - Low Level Connection Infocassandra.util - Utilitiescassandra.timestamps - Timestamp Generationcassandra.io.asyncioreactor - asyncio Event Loopcassandra.io.asyncorereactor - asyncore Event Loopcassandra.io.eventletreactor - eventlet-compatible Connectioncassandra.io.libevreactor - libev Event Loopcassandra.io.geventreactor - gevent-compatible Event Loopcassandra.io.twistedreactor - Twisted Event Loopcassandra.cqlengine.models - Table models for object mappingcassandra.cqlengine.columns - Column types for object mapping modelscassandra.cqlengine.query - Query and filter model objectscassandra.cqlengine.connection - Connection management for cqlenginecassandra.cqlengine.management - Schema management for cqlenginecassandra.cqlengine.usertype - Model classes for User Defined Typescassandra.datastax.graph - Graph Statements, Options, and Row Factoriescassandra.datastax.graph.fluentcassandra.datastax.graph.fluent.querycassandra.datastax.graph.fluent.predicates