Google.Cloud.Spanner.Data - Namespace Google.Cloud.Spanner.Data (4.2.0)

Classes

CommandPartition

Represents a partition of data upon which a SpannerCommand will execute. Partitions are useful for parallelizing large operations across several tasks or processes.

Key

Immutable class that defines a key for a single row in a table or index.

KeyRange

Immutable class that defines a range of keys to select from a table or index.

KeySet

Immutable class that defines a set of keys to select from a table or index. KeySets are used for Read operations to specify the rows that should be returned by the read. A KeySet can be created from a set of individual keys or a set of key ranges. The All instance can be used for read operations that should return all rows.

QueryOptions

Immutable class representing query options.

ReadOptions

ReadOptions define a read operation for a Spanner table.

SessionPoolManager

Manages sessions used by SpannerConnection. This is rarely used directly by user code; it's public to provide flexibility when custom options are required.

SpannerBatchCommand

Represents batched commands to execute against a Spanner database. Currently only DML commands are supported in batch mode.

You can create an instance of SpannerBatchCommand with no initial commands. You can then add commands to a SpannerBatchCommand using the Add(SpannerCommandTextBuilder, SpannerParameterCollection) or Add(String, SpannerParameterCollection) or Add(SpannerCommand) methods.

For batched DML commands use ExecuteNonQueryAsync(CancellationToken) or ExecuteNonQuery() to execute the batched commands.

SpannerBatchNonQueryException

Represents an error communicating with the Spanner database when executing batch non query operations.

SpannerCommand

Represents a SQL query or command to execute against a Spanner database. If the command is a SQL query, then CommandText contains the entire SQL statement. Use ExecuteReaderAsync() to obtain results.

If the command is an update, insert or delete command, then CommandText is simply "[operation] [spanner_table]" such as "UPDATE MYTABLE" with the parameter collection containing SpannerParameter instances whose name matches a column in the target table. Use ExecuteNonQueryAsync(CancellationToken) to execute the command.

The command may also be a DDL statement such as CREATE TABLE. Use ExecuteNonQueryAsync(CancellationToken) to execute a DDL statement.

SpannerCommandTextBuilder

Builds the CommandText string for executing a query or operation on a Spanner database. Instances are constructed with static factory methods.

SpannerConnection

Represents a connection to a single Spanner database. When opened, SpannerConnection will acquire and maintain a session with the target Spanner database. SpannerCommand instances using this SpannerConnection will use this session to execute their operation. Concurrent read operations can share this session, but concurrent write operations may cause additional sessions to be opened to the database. Underlying sessions with the Spanner database are pooled and are closed after a configurable .

SpannerConnectionStringBuilder

A connection string builder for Spanner connection strings. The connection string should be of the form: Data Source=projects/{project}/instances/{instance}/databases/{database};[Host={hostname};][Port={portnumber}]

SpannerDataAdapter

Represents a set of data commands and a database connection that are used to fill the DataSet and update a Spanner database.

SpannerDataReader

Reads a forward-only stream of rows from a data source.

SpannerDbType

Represents a Type that can be stored in a Spanner column or returned from a query.

SpannerException

Represents an error communicating with the Spanner database.

SpannerParameter

Represents a parameter to a SpannerCommand and optionally its mapping to DataSet columns.

SpannerParameterCollection

Represents a collection of parameters associated with a SpannerCommand and their respective mappings to columns in a DataSet.

SpannerProviderFactory

Represents a set of methods for creating instances of the Spanner data provider's implementation of the data source classes.

SpannerRowUpdatedEventArgs

Provides data for the RowUpdated event of the Spanner data provider.

SpannerRowUpdatingEventArgs

Provides data for the RowUpdating event of the Spanner data provider.

SpannerStruct

A struct parameter or returned value.

SpannerStruct.Field

A field within a struct.

SpannerTransaction

Represents a SQL transaction to be made in a Spanner database. A transaction in Cloud Spanner is a set of reads and writes that execute atomically at a single logical point in time across columns, rows, and tables in a database.

SpannerTransactionBase

Base class for SpannerTransaction, used for compatibility purposes with DbTransaction. (This class is able to override a new method added to DbTransaction, even if it clashes with an existing method declaration in SpannerTransaction.)

TimestampBound

Indicates how Spanner will choose a timestamp at which to read the data for read-only transactions.

TransactionId

A TransactionId holds identifying information about an active transaction in Cloud Spanner. Since it is serializable, it enables you to send this information to another process or machine so it may connect to the same transaction.

TransientFaultDetector

Transactions can be retried using the Transient Fault Handling Application Block. This extension helps you create a strategy that will detect transient faults when performing transactions with Spanner. To create an execution strategy, create a class

class SpannerTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
{
  public bool IsTransient(Exception ex) => ex.IsTransientSpannerFault();
}

Enums

DisposeBehavior

Defines the behavior of SpannerTransaction when Dispose is called.

ErrorCode

A detailed code supplied via ErrorCode when an error occurs.

Priority

The relative priority for requests.

SpannerBatchCommandType

Indicates the type of SpannerBatchCommand that will be executed.

SpannerCommandType

Indicates the type of SpannerCommand that will be executed.

TimestampBoundMode

Indicates how to choose the timestamp at which to read the data for Cloud Spanner read-only transactions. If your application can tolerate some staleness when reading data, you can use a stale read, which can execute much faster when compared to reading the latest data.

TransactionMode

Indicates the mode for the transaction.