Google.Cloud.Spanner.Data - Class ReadOptions (5.0.0-beta03)

public sealed class ReadOptions

Reference documentation and code samples for the Google.Cloud.Spanner.Data class ReadOptions.

ReadOptions define a read operation for a Spanner table.

Inheritance

object > ReadOptions

Namespace

Google.Cloud.Spanner.Data

Assembly

Google.Cloud.Spanner.Data.dll

Properties

Columns

public IReadOnlyList<string> Columns { get; }

Returns the columns that will be read from the target table. Cannot be null or empty.

Property Value
TypeDescription
IReadOnlyListstring

IndexName

public string IndexName { get; }

The index to use to search and order rows from the target table if the read operation should use a different index than the primary key, or null otherwise. The rows will be returned in the order of the specified index.

Property Value
TypeDescription
string

Limit

public long? Limit { get; }

The maximum number of rows to read from the target table, or null if there is no limit.

Property Value
TypeDescription
long

Methods

FromColumns(IEnumerable<string>)

public static ReadOptions FromColumns(IEnumerable<string> columns)

Creates options to read the given columns using a ReadCommand.

Parameter
NameDescription
columnsIEnumerablestring

The columns to read from the target table. Must not be null or empty.

Returns
TypeDescription
ReadOptions

FromColumns(params string[])

public static ReadOptions FromColumns(params string[] columns)

Creates options to read the given columns using a ReadCommand.

Parameter
NameDescription
columnsstring

The columns to read from the target table. Must not be null or empty.

Returns
TypeDescription
ReadOptions

WithIndexName(string)

public ReadOptions WithIndexName(string indexName)

Returns a clone of this ReadOptions with the given index name.

Parameter
NameDescription
indexNamestring

The index to use to search and order rows from the target table if the read operation should use a different index than the primary key. The rows will be returned in the order of the specified index. May not an empty string. Null means that the primary key of the table should be used for the read operation.

Returns
TypeDescription
ReadOptions

A clone of this ReadOptions with the given index name.

WithLimit(long?)

public ReadOptions WithLimit(long? limit)

Creates a clone of this ReadOptions with the given limit.

Parameter
NameDescription
limitlong

The maximum number of rows to read. Must be larger than 0. Null means no limit.

Returns
TypeDescription
ReadOptions

A clone of this ReadOptions with the given limit.