public sealed class SpannerDataReader : DbDataReader, IEnumerable, IDataReader, IDataRecord, IDisposable
Reads a forward-only stream of rows from a data source.
Namespace
Google.Cloud.Spanner.Data
Assembly
Google.Cloud.Spanner.Data.dll
Properties
Depth
public override int Depth { get; }
Property Value |
---|
Type | Description |
Int32 | |
Overrides
FieldCount
public override int FieldCount { get; }
Property Value |
---|
Type | Description |
Int32 | |
Overrides
HasRows
public override bool HasRows { get; }
Gets a value that indicates whether the SpannerDataReader contains one or more rows.
If any rows have been read, this will continue to return true even when there are no more rows.
Property Value |
---|
Type | Description |
Boolean | |
Overrides
IsClosed
public override bool IsClosed { get; }
Property Value |
---|
Type | Description |
Boolean | |
Overrides
Item[Int32]
public override object this[int i] { get; }
Parameter |
---|
Name | Description |
i | Int32
|
Property Value |
---|
Type | Description |
Object | |
Overrides
Item[String]
public override object this[string name] { get; }
Parameter |
---|
Name | Description |
name | String
|
Property Value |
---|
Type | Description |
Object | |
Overrides
RecordsAffected
public override int RecordsAffected { get; }
Property Value |
---|
Type | Description |
Int32 | |
Overrides
Methods
Close()
public override void Close()
Overrides
Dispose(Boolean)
protected override void Dispose(bool disposing)
Parameter |
---|
Name | Description |
disposing | Boolean
|
Overrides
GetBoolean(Int32)
public override bool GetBoolean(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetByte(Int32)
public override byte GetByte(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Byte | |
Overrides
GetBytes(Int32, Int64, Byte[], Int32, Int32)
public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Returns |
---|
Type | Description |
Int64 | |
Overrides
GetChar(Int32)
public override char GetChar(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Char | |
Overrides
GetChars(Int32, Int64, Char[], Int32, Int32)
public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Returns |
---|
Type | Description |
Int64 | |
Overrides
GetDataTypeName(Int32)
public override string GetDataTypeName(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetDateTime(Int32)
public override DateTime GetDateTime(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetDecimal(Int32)
public override decimal GetDecimal(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetDouble(Int32)
public override double GetDouble(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetEnumerator()
public override IEnumerator GetEnumerator()
Overrides
GetFieldType(Int32)
public override Type GetFieldType(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Type | |
Overrides
GetFieldValue<T>(Int32)
public override T GetFieldValue<T>(int ordinal)
Parameter |
---|
Name | Description |
ordinal | Int32
|
Type Parameter |
---|
Name | Description |
T | |
Overrides
GetFieldValue<T>(String)
public T GetFieldValue<T>(string columnName)
Gets the value of the specified column as type T.
Parameter |
---|
Name | Description |
columnName | String
The name of the column whose value will be returned. Must not be null.
|
Returns |
---|
Type | Description |
T | The value of the column at the current row, converted to type T.
|
Type Parameter |
---|
Name | Description |
T | The expected return type. If possible the return type will be converted to this type.
If conversion is requested between incompatible types, an InvalidOperationException
will be thrown.
If the conversion fails due to the contents returned (for example a string representing a
boolean does not have either 'true' or 'false') then a FormatException exception will be
thrown as documented by the Convert class.
|
GetFloat(Int32)
public override float GetFloat(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetGuid(Int32)
public override Guid GetGuid(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Guid | |
Overrides
GetInt16(Int32)
public override short GetInt16(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Int16 | |
Overrides
GetInt32(Int32)
public override int GetInt32(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Int32 | |
Overrides
GetInt64(Int32)
public override long GetInt64(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Returns |
---|
Type | Description |
Int64 | |
Overrides
GetJsonValue(Int32)
public Value GetJsonValue(int i)
Gets the value of the specified column as a pure Protobuf type.
Parameter |
---|
Name | Description |
i | Int32
The index of the column whose value will be returned.
|
Returns |
---|
Type | Description |
Google.Protobuf.WellKnownTypes.Value | The raw protobuf as a Google.Protobuf.WellKnownTypes.Value.
|
GetName(Int32)
public override string GetName(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetNumeric(Int32)
public SpannerNumeric GetNumeric(int i)
Gets the value of the specified column as type Google.Cloud.Spanner.V1.SpannerNumeric.
Parameter |
---|
Name | Description |
i | Int32
The index of the column to retrieve.
|
Returns |
---|
Type | Description |
Google.Cloud.Spanner.V1.SpannerNumeric | The value converted to a Google.Cloud.Spanner.V1.SpannerNumeric.
|
GetOrdinal(String)
public override int GetOrdinal(string name)
Parameter |
---|
Name | Description |
name | String
|
Returns |
---|
Type | Description |
Int32 | |
Overrides
GetOrdinalAsync(String, CancellationToken)
public Task<int> GetOrdinalAsync(string name, CancellationToken cancellationToken = default(CancellationToken))
Returns the column ordinal given the name of the column, asynchronously requesting metadata from
the database if necessary.
Parameters |
---|
Name | Description |
name | String
The name of the column.
|
cancellationToken | CancellationToken
A cancellation token to cancel reading metadata. Defaults to None.
|
Returns |
---|
Type | Description |
Task<Int32> | The zero-based column ordinal.
|
GetSchemaTable()
public override DataTable GetSchemaTable()
When enabled, returns the schema of the query as a DataTable. This feature needs
to be enabled in the connection string via the EnableGetSchemaTable property.
Returns |
---|
Type | Description |
DataTable | A DataTable with schema information about the query, or null if the feature
is not enabled in the connection string.
|
Overrides
Remarks
GetString(Int32)
public override string GetString(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetTimestamp(Int32)
public Timestamp GetTimestamp(int i)
Gets the value of the specified column as type Google.Protobuf.WellKnownTypes.Timestamp.
Parameter |
---|
Name | Description |
i | Int32
The index of the column to retrieve.
|
Returns |
---|
Type | Description |
Google.Protobuf.WellKnownTypes.Timestamp | The value converted to a Google.Protobuf.WellKnownTypes.Timestamp.
|
GetValue(Int32)
public override object GetValue(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
GetValues(Object[])
public override int GetValues(object[] values)
Parameter |
---|
Name | Description |
values | Object[]
|
Returns |
---|
Type | Description |
Int32 | |
Overrides
IsDBNull(Int32)
public override bool IsDBNull(int i)
Parameter |
---|
Name | Description |
i | Int32
|
Overrides
NextResult()
public override bool NextResult()
Overrides
Read()
public override bool Read()
Overrides
ReadAsync(CancellationToken)
public override Task<bool> ReadAsync(CancellationToken cancellationToken)
Reads the next row of values from Cloud Spanner.
Important: Cloud Spanner supports limited cancellation of this task.
Parameter |
---|
Name | Description |
cancellationToken | CancellationToken
A cancellation token to cancel the read. Cloud Spanner currently
supports limited cancellation while advancing the read to the next row.
|
Returns |
---|
Type | Description |
Task<Boolean> | True if another row was read.
|
Overrides