• 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 Statement

    Base class for statements that contains the options.

    Inheritance
    object
    Statement
    BatchStatement
    BoundStatement
    Batch
    CqlQueryBase<TEntity>
    RegularStatement
    Implements
    IStatement
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Cassandra
    Assembly: Cassandra.dll
    Syntax
    public abstract class Statement : IStatement

    Constructors

    Statement()

    Declaration
    protected Statement()

    Statement(QueryProtocolOptions)

    Declaration
    protected Statement(QueryProtocolOptions queryProtocolOptions)
    Parameters
    Type Name Description
    QueryProtocolOptions queryProtocolOptions

    Fields

    ProxyExecuteKey

    Declaration
    protected const string ProxyExecuteKey = "ProxyExecute"
    Field Value
    Type Description
    string

    Properties

    AutoPage

    Determines if the RowSet returned when executing this IStatement will automatically fetch the following result pages. Defaults to true.

    Declaration
    public bool AutoPage { get; }
    Property Value
    Type Description
    bool

    ConsistencyLevel

    Gets the consistency level for this query.

    Declaration
    public ConsistencyLevel? ConsistencyLevel { get; }
    Property Value
    Type Description
    ConsistencyLevel?

    Host

    Gets the host configured on this Statement, or null if none is configured.

    In the general case, the host used to execute this Statement will depend on the configured ILoadBalancingPolicy and this property will return null.

    SetHost(Host)
    Declaration
    public Host Host { get; }
    Property Value
    Type Description
    Host

    IsIdempotent

    Determines if this statement is idempotent, i.e. whether it can be applied multiple times without changing the result beyond the initial application.

    Idempotence of the statement plays a role in ISpeculativeExecutionPolicy. If a statement is not idempotent, the driver will not schedule speculative executions for it.

    When the property is null, the driver will use the default value from the GetDefaultIdempotence().
    Declaration
    public bool? IsIdempotent { get; }
    Property Value
    Type Description
    bool?

    IsTracing

    Gets whether tracing is enabled for this query or not.

    Declaration
    public bool IsTracing { get; }
    Property Value
    Type Description
    bool

    Keyspace

    Returns the keyspace this query operates on.

    Note that not all Statement implementations specify on which keyspace they operate on so this method can return null. If null, it will operate on the default keyspace set during initialization (if it was set).

    The keyspace returned is used as a hint for token-aware routing.

    Declaration
    public virtual string Keyspace { get; }
    Property Value
    Type Description
    string
    Remarks

    Consider using a ISession connected to single keyspace using Connect(string).

    OutgoingPayload

    Gets custom payload for that will be included when executing this Statement.

    Declaration
    public IDictionary<string, byte[]> OutgoingPayload { get; }
    Property Value
    Type Description
    IDictionary<string, byte[]>

    PageSize

    Gets query's page size.

    Declaration
    public int PageSize { get; }
    Property Value
    Type Description
    int

    PagingState

    This object represents the next page to be fetched if the query is multi page. It can be saved and reused later on a different execution.

    Declaration
    public byte[] PagingState { get; }
    Property Value
    Type Description
    byte[]

    QueryValues

    Declaration
    public virtual object[] QueryValues { get; }
    Property Value
    Type Description
    object[]

    ReadTimeoutMillis

    Gets the per-host read timeout for this statement.

    When the value is 0 or lower, the default value from the socket options will be used.

    Declaration
    public int ReadTimeoutMillis { get; }
    Property Value
    Type Description
    int

    RetryPolicy

    Gets the retry policy sets for this query, if any.

    Declaration
    public IRetryPolicy RetryPolicy { get; }
    Property Value
    Type Description
    IRetryPolicy

    RoutingKey

    The routing key (in binary raw form) to use for token aware routing of this query.

    The routing key is optional in the sense that implementers are free to return null. The routing key is an hint used for token aware routing (see

    TokenAwarePolicy), and if provided should correspond to the binary value for the query partition key. However, not providing a routing key never causes a query to fail and if the load balancing policy used is not token aware, then the routing key can be safely ignored.
    Declaration
    public abstract RoutingKey RoutingKey { get; }
    Property Value
    Type Description
    RoutingKey

    SerialConsistencyLevel

    Gets the serial consistency level for this query.

    Declaration
    public ConsistencyLevel SerialConsistencyLevel { get; }
    Property Value
    Type Description
    ConsistencyLevel

    SkipMetadata

    Declaration
    public bool SkipMetadata { get; }
    Property Value
    Type Description
    bool

    Timestamp

    Gets the timestamp associated with this statement execution.

    Declaration
    public DateTimeOffset? Timestamp { get; }
    Property Value
    Type Description
    DateTimeOffset?

    Methods

    DisableTracing()

    Disable tracing for the statement.

    Declaration
    public IStatement DisableTracing()
    Returns
    Type Description
    IStatement

    EnableTracing(bool)

    Enables tracing for the statement

    Declaration
    public IStatement EnableTracing(bool enable = true)
    Parameters
    Type Name Description
    bool enable
    Returns
    Type Description
    IStatement

    ExecutingAs(string)

    Allows this statement to be executed as a different user/role than the one currently authenticated (a.k.a. proxy execution).

    Declaration
    public IStatement ExecutingAs(string userOrRole)
    Parameters
    Type Name Description
    string userOrRole

    The user or role name to act as when executing this statement.

    Returns
    Type Description
    IStatement

    This statement

    Remarks

    This feature is only available in DSE 5.1+.

    SetAutoPage(bool)

    Sets the paging behavior. When set to true (default), the RowSet returned when executing this IStatement will automatically fetch the following result pages. When false, the RowSet returned will only contain the rows contained in the result page and will not fetch additional pages.

    Declaration
    public IStatement SetAutoPage(bool autoPage)
    Parameters
    Type Name Description
    bool autoPage
    Returns
    Type Description
    IStatement

    this IStatement object.

    SetConsistencyLevel(ConsistencyLevel?)

    Sets the consistency level for the query.

    The default consistency level, if this method is not called, is ConsistencyLevel.ONE.

    Declaration
    public IStatement SetConsistencyLevel(ConsistencyLevel? consistency)
    Parameters
    Type Name Description
    ConsistencyLevel? consistency

    the consistency level to set.

    Returns
    Type Description
    IStatement

    this IStatement object.

    SetHost(Host)

    Sets the Host that should handle this query.

    In the general case, use of this method is heavily discouraged and should only be used in the following cases:

    • Querying node-local tables, such as tables in the system and system_views keyspaces.
    • Applying a series of schema changes, where it may be advantageous to execute schema changes in sequence on the same node.

    Configuring a specific host causes the configured ILoadBalancingPolicy to be completely bypassed. However, if the load balancing policy dictates that the host is at distance Ignored or there is no active connectivity to the host, the request will fail with a NoHostAvailableException.

    Declaration
    public IStatement SetHost(Host host)
    Parameters
    Type Name Description
    Host host

    The host that should be used to handle executions of this statement or null to delegate to the configured load balancing policy.

    Returns
    Type Description
    IStatement

    this instance

    SetIdempotence(bool)

    Sets whether this statement is idempotent.

    Idempotence of the statement plays a role in ISpeculativeExecutionPolicy. If a statement is not idempotent, the driver will not schedule speculative executions for it.

    Declaration
    public IStatement SetIdempotence(bool value)
    Parameters
    Type Name Description
    bool value
    Returns
    Type Description
    IStatement

    SetOutgoingPayload(IDictionary<string, byte[]>)

    Sets a custom outgoing payload for this statement. Each time this statement is executed, this payload will be included in the request. Once it is set using this method, the payload should not be modified.

    Declaration
    public IStatement SetOutgoingPayload(IDictionary<string, byte[]> payload)
    Parameters
    Type Name Description
    IDictionary<string, byte[]> payload
    Returns
    Type Description
    IStatement

    SetPageSize(int)

    Sets the page size for this query. The page size controls how much resulting rows will be retrieved simultaneously (the goal being to avoid loading too much results in memory for queries yielding large results). Please note that while value as low as 1 can be used, it is highly discouraged to use such a low value in practice as it will yield very poor performance. If in doubt, leaving the default is probably a good idea.

    Also note that only SELECT queries ever make use of that setting.

    the page size to use. If set to 0 or less, the default value will be used. To disable paging of the result set, use int.MaxValuethis Query object.
    Declaration
    public IStatement SetPageSize(int pageSize)
    Parameters
    Type Name Description
    int pageSize
    Returns
    Type Description
    IStatement

    SetPagingState(byte[])

    Sets the paging state, a token representing the current page state of query used to continue paging by retrieving the following result page. Setting the paging state will disable automatic paging.

    Declaration
    public IStatement SetPagingState(byte[] pagingState)
    Parameters
    Type Name Description
    byte[] pagingState

    The page state token

    Returns
    Type Description
    IStatement

    this IStatement object.

    SetReadTimeoutMillis(int)

    Overrides the default per-host read timeout ReadTimeoutMillis for this statement.

    Declaration
    public IStatement SetReadTimeoutMillis(int timeout)
    Parameters
    Type Name Description
    int timeout

    Timeout in milliseconds. If the value is not greater than zero, the default value from the socket options will be used.

    Returns
    Type Description
    IStatement

    SetRetryPolicy(IRetryPolicy)

    Sets the retry policy to use for this query.

    Calling this method is only required when you want to override the default RetryPolicy set in the cluster configuration for this request or the one set in the execution profile (see RetryPolicy) for this request.

    Use a IExtendedRetryPolicy implementation to cover all error scenarios.

    Declaration
    public IStatement SetRetryPolicy(IRetryPolicy policy)
    Parameters
    Type Name Description
    IRetryPolicy policy

    The retry policy to use for this query.

    Returns
    Type Description
    IStatement

    this IStatement instance.

    SetSerialConsistencyLevel(ConsistencyLevel)

    Sets the serial consistency level for the query. The serial consistency level is only used by conditional updates (so INSERT, UPDATE and DELETE with an IF condition). For those, the serial consistency level defines the consistency level of the serial phase (or "paxos" phase) while the normal consistency level defines the consistency for the "learn" phase, i.e. what type of reads will be guaranteed to see the update right away. For instance, if a conditional write has a regular consistency of QUORUM (and is successful), then a QUORUM read is guaranteed to see that write. But if the regular consistency of that write is ANY, then only a read with a consistency of SERIAL is guaranteed to see it (even a read with consistency ALL is not guaranteed to be enough).

    Declaration
    public IStatement SetSerialConsistencyLevel(ConsistencyLevel serialConsistency)
    Parameters
    Type Name Description
    ConsistencyLevel serialConsistency

    Can be set only to ConsistencyLevel.Serial or ConsistencyLevel.LocalSerial. Setting it to ConsistencyLevel.Serial guarantees full linearizability while ConsistencyLevel.LocalSerial guarantees it only in the local datacenter.

    Returns
    Type Description
    IStatement

    this IStatement object.

    SetTimestamp(DateTimeOffset)

    Sets the timestamp associated with this statement execution. If provided, this will replace the server side assigned timestamp as default timestamp. Note that a timestamp in the query itself will still override this timestamp.

    Declaration
    public IStatement SetTimestamp(DateTimeOffset value)
    Parameters
    Type Name Description
    DateTimeOffset value
    Returns
    Type Description
    IStatement

    Implements

    IStatement
    Back to top © DataStax, All rights reserved.