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.
Namespace
GoogleCloudGoogle.Cloud.SpannerDataAssembly
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
long |
Methods
FromColumns(IEnumerable<string>)
public static ReadOptions FromColumns(IEnumerable<string> columns)
Creates options to read the given columns using a ReadCommand.
Parameter | |
---|---|
Name | Description |
columns | IEnumerablestring The columns to read from the target table. Must not be null or empty. |
Returns | |
---|---|
Type | Description |
ReadOptions |
FromColumns(params string[])
public static ReadOptions FromColumns(params string[] columns)
Creates options to read the given columns using a ReadCommand.
Parameter | |
---|---|
Name | Description |
columns | string The columns to read from the target table. Must not be null or empty. |
Returns | |
---|---|
Type | Description |
ReadOptions |
WithIndexName(string)
public ReadOptions WithIndexName(string indexName)
Returns a clone of this ReadOptions with the given index name.
Parameter | |
---|---|
Name | Description |
indexName | string 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
limit | long The maximum number of rows to read. Must be larger than 0. Null means no limit. |
Returns | |
---|---|
Type | Description |
ReadOptions | A clone of this ReadOptions with the given limit. |