• DataStax C# Driver for Apache Cassandra API Documentation
Search Results for

    Show / Hide Table of Contents
    • Cassandra
      • AesColumnEncryptionPolicy
      • AesColumnEncryptionPolicy.AesKeyAndIV
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BaseColumnEncryptionPolicy<TKey>
      • BaseColumnEncryptionPolicy<TKey>.ColMetadataKey
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnEncryptionInvalidTypeError
      • ColumnEncryptionMetadata
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CqlVector<T>
      • CustomColumnInfo
      • DCAwareRoundRobinPolicy
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DecimalTypeAdapter
      • DefaultLoadBalancingPolicy
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • EncryptedValue
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • GraphProtocol
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthProvider
      • IAuthenticator
      • ICluster
      • IColumnEncryptionPolicy
      • IColumnInfo
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRequestTracker
      • IRetryPolicy
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • IdempotenceAwareRetryPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InitFatalErrorException
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IsBootstrappingException
      • KeyType
      • KeyspaceMetadata
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoSpeculativeExecutionPolicy
      • NodeRequestInfo
      • NoneAuthProvider
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PrepareRequest
      • PreparedQueryNotFoundException
      • PreparedStatement
      • PreparedStatementIdMismatchException
      • ProtocolErrorException
      • ProtocolOptions
      • ProtocolVersion
      • QueryExecutionException
      • QueryOptions
      • QueryProtocolOptions
      • QueryProtocolOptions.QueryFlags
      • QueryTimeoutException
      • QueryTrace
      • QueryTrace.Event
      • QueryValidationException
      • ReadFailureException
      • ReadTimeoutException
      • RegularStatement
      • ReplicationStrategies
      • RequestInvalidException
      • RetryDecision
      • RetryDecision.RetryDecisionType
      • RetryLoadBalancingPolicy
      • RetryLoadBalancingPolicyEventArgs
      • RoundRobinPolicy
      • RoutingKey
      • Row
      • RowSet
      • RowSetMetadata
      • SSLOptions
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SessionRequestInfo
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • ToManyConnectionsPerHost
      • TokenAwarePolicy
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • VectorColumnInfo
      • WriteFailureException
      • WriteTimeoutException
    • Cassandra.AppMetrics
      • DriverAppMetricsOptions
    • Cassandra.AppMetrics.MetricTypes
      • IAppMetricsCounter
      • IAppMetricsGauge
      • IAppMetricsMeter
      • IAppMetricsMetric
      • IAppMetricsTimer
    • Cassandra.AppMetrics.MetricValues
      • IAppMetricsHistogramValue
      • IAppMetricsMeterValue
      • IAppMetricsMetricWithValue<T>
      • IAppMetricsTimerValue
    • Cassandra.Data
      • CqlBatchTransaction
      • CqlCommand
      • CqlConnection
      • CqlDataAdapter
      • CqlParameter
      • CqlParameterCollection
      • CqlProviderFactory
      • CqlReader
    • Cassandra.Data.Linq
      • AllowFilteringAttribute
      • Batch
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CompactStorageAttribute
      • CounterAttribute
      • CqlArgumentException
      • CqlCommand
      • CqlConditionalCommand<TEntity>
      • CqlDelete
      • CqlFunction
      • CqlInsert<TEntity>
      • CqlLinqNotSupportedException
      • CqlOperator
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlQuery<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • ITable
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • TableAttribute
      • TableType
      • Table<TEntity>
    • Cassandra.DataStax.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Cassandra.DataStax.Auth.Sspi
      • SspiException
    • Cassandra.DataStax.Graph
      • Direction
      • Edge
      • Element
      • ElementMap
      • EnumWrapper
      • FluentGraphStatement
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IPropertyWithElement
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • TEnum
      • Traverser
      • Vertex
    • Cassandra.DataStax.Graph.Internal
      • IGraphSONDeserializer
      • IGraphSONReader
      • IGraphSONSerializer
      • IGraphSONWriter
    • Cassandra.DataStax.Search
      • DateRange
      • DateRangeBound
      • DateRangePrecision
    • Cassandra.Geometry
      • GeometryBase
      • LineString
      • Point
      • Polygon
    • Cassandra.Mapping
      • AppliedInfo<T>
      • ColumnMap
      • Cql
      • CqlQueryOptions
      • IColumnDefinition
      • ICqlBatch
      • ICqlQueryAsyncClient
      • ICqlQueryClient
      • ICqlWriteAsyncClient
      • ICqlWriteClient
      • IMapper
      • IPage<T>
      • ITypeDefinition
      • Map<TPoco>
      • Mapper
      • MappingConfiguration
      • Mappings
      • PrimaryKeyAttribute
      • SortOrder
      • TableNameAttribute
    • Cassandra.Mapping.Attributes
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CounterAttribute
      • FrozenAttribute
      • FrozenKeyAttribute
      • FrozenValueAttribute
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • StaticColumnAttribute
      • TableAttribute
    • Cassandra.Mapping.TypeConversion
      • DefaultTypeConverter
      • EnumStringMapper<T>
      • NullableEnumStringMapper<T>
      • TypeConverter
    • Cassandra.Mapping.Utils
      • MemberInfoExtensions
    • Cassandra.Metrics
      • DriverMetricsOptions
      • IDriverMetrics
      • IMetric
      • IMetricsRegistry<TMetric>
      • NodeMetric
      • NodeMetric.Counters
      • NodeMetric.Gauges
      • NodeMetric.Meters
      • NodeMetric.Timers
      • SessionMetric
      • SessionMetric.Counters
      • SessionMetric.Gauges
      • SessionMetric.Meters
      • SessionMetric.Timers
    • Cassandra.Metrics.Abstractions
      • IDriverCounter
      • IDriverGauge
      • IDriverMeter
      • IDriverMetric
      • IDriverMetricsProvider
      • IDriverTimer
    • Cassandra.OpenTelemetry
      • BuilderExtensions
      • CassandraActivitySourceHelper
      • CassandraInstrumentationOptions
      • OpenTelemetryRequestTracker
    • Cassandra.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializerDefinitions
      • TypeSerializer<T>
      • UdtSerializer
    • Cassandra.Serialization.Primitive
      • DecimalSerializer

    Class CqlConnection

    Represents a CQL connection.

    Inheritance
    object
    MarshalByRefObject
    Component
    DbConnection
    CqlConnection
    Implements
    IComponent
    IDbConnection
    IDisposable
    ICloneable
    Inherited Members
    DbConnection.BeginTransaction()
    DbConnection.BeginTransaction(IsolationLevel)
    DbConnection.CreateCommand()
    DbConnection.EnlistTransaction(Transaction)
    DbConnection.GetSchema()
    DbConnection.GetSchema(string)
    DbConnection.GetSchema(string, string[])
    DbConnection.OnStateChange(StateChangeEventArgs)
    DbConnection.OpenAsync()
    DbConnection.OpenAsync(CancellationToken)
    DbConnection.ConnectionTimeout
    DbConnection.StateChange
    Component.Dispose()
    Component.GetService(Type)
    Component.ToString()
    Component.CanRaiseEvents
    Component.Container
    Component.DesignMode
    Component.Events
    Component.Site
    Component.Disposed
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.MemberwiseClone(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Cassandra.Data
    Assembly: Cassandra.dll
    Syntax
    public class CqlConnection : DbConnection, IComponent, IDbConnection, IDisposable, ICloneable

    Constructors

    CqlConnection()

    Initializes a CqlConnection.

    Declaration
    public CqlConnection()

    CqlConnection(string)

    Initializes a CqlConnection.

    Declaration
    public CqlConnection(string connectionString)
    Parameters
    Type Name Description
    string connectionString

    The connection string.

    Fields

    ManagedConnection

    Declaration
    protected ISession ManagedConnection
    Field Value
    Type Description
    ISession

    Properties

    ConnectionString

    Declaration
    public override string ConnectionString { get; set; }
    Property Value
    Type Description
    string
    Overrides
    DbConnection.ConnectionString

    DataSource

    Declaration
    public override string DataSource { get; }
    Property Value
    Type Description
    string
    Overrides
    DbConnection.DataSource

    Database

    Returns the Keyspace

    Declaration
    public override string Database { get; }
    Property Value
    Type Description
    string
    Overrides
    DbConnection.Database

    DbProviderFactory

    Declaration
    protected override DbProviderFactory DbProviderFactory { get; }
    Property Value
    Type Description
    DbProviderFactory
    Overrides
    DbConnection.DbProviderFactory

    ServerVersion

    Declaration
    public override string ServerVersion { get; }
    Property Value
    Type Description
    string
    Overrides
    DbConnection.ServerVersion

    State

    Declaration
    public override ConnectionState State { get; }
    Property Value
    Type Description
    ConnectionState
    Overrides
    DbConnection.State

    Methods

    BeginDbTransaction(IsolationLevel)

    Declaration
    protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
    Parameters
    Type Name Description
    IsolationLevel isolationLevel
    Returns
    Type Description
    DbTransaction
    Overrides
    DbConnection.BeginDbTransaction(IsolationLevel)

    ChangeDatabase(string)

    Declaration
    public override void ChangeDatabase(string databaseName)
    Parameters
    Type Name Description
    string databaseName
    Overrides
    DbConnection.ChangeDatabase(string)

    Clone()

    Declaration
    public object Clone()
    Returns
    Type Description
    object

    Close()

    Declaration
    public override void Close()
    Overrides
    DbConnection.Close()

    CreateCluster(CassandraConnectionStringBuilder)

    Creates a Cluster. By default Clusters are created and cached by cluster name specified in connection string.

    To be overridden in child classes to change the default creation and caching behavior.

    Declaration
    protected virtual Cluster CreateCluster(CassandraConnectionStringBuilder connectionStringBuilder)
    Parameters
    Type Name Description
    CassandraConnectionStringBuilder connectionStringBuilder

    The CassandraConnectionStringBuilder.

    Returns
    Type Description
    Cluster

    CreateDbCommand()

    Declaration
    protected override DbCommand CreateDbCommand()
    Returns
    Type Description
    DbCommand
    Overrides
    DbConnection.CreateDbCommand()

    CreatePreparedStatement(string)

    To be called by CqlCommand to creates a PreparedStatement from ManagedConnection.

    To be overridden in child classes if want to cache the PreparedStatement created.

    Declaration
    protected virtual PreparedStatement CreatePreparedStatement(string cqlQuery)
    Parameters
    Type Name Description
    string cqlQuery

    The CQL query string.

    Returns
    Type Description
    PreparedStatement

    Returns the created PreparedStatement.

    CreatedSession(string)

    Creates a ISession.

    To be overridden in child classes if want to cache the ISession created.

    Declaration
    protected virtual ISession CreatedSession(string keyspace)
    Parameters
    Type Name Description
    string keyspace

    The keyspace.

    Returns
    Type Description
    ISession

    Returns the created ISession.

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    Component.Dispose(bool)

    OnBuildingCluster(Builder)

    To be overridden in child classes to change the default Builder settings for building a Cluster.

    For example, some clients might want to specify the DCAwareRoundRobinPolicy when building the Cluster so that the clients could talk to only the hosts in specified datacenter for better performance.

    Declaration
    protected virtual void OnBuildingCluster(Builder builder)
    Parameters
    Type Name Description
    Builder builder

    The Builder for building a Cluster.

    Open()

    Declaration
    public override void Open()
    Overrides
    DbConnection.Open()

    Implements

    IComponent
    IDbConnection
    IDisposable
    ICloneable
    Back to top © DataStax, All rights reserved.