Class ReadOptions (3.13.0)

public sealed 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
IReadOnlyList<String>

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
Nullable<Int64>

Methods

FromColumns(IEnumerable<String>)

public static ReadOptions FromColumns(IEnumerable<string> columns)

Creates options to read the given columns using a ReadCommand.

Parameter
NameDescription
columnsIEnumerable<String>

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

Returns
TypeDescription
ReadOptions

FromColumns(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(Nullable<Int64>)

public ReadOptions WithLimit(long? limit)

Creates a clone of this ReadOptions with the given limit.

Parameter
NameDescription
limitNullable<Int64>

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.