Google.Cloud.Spanner.Data - Class KeyRange (4.1.0)

public sealed class KeyRange

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

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

Inheritance

Object > KeyRange

Namespace

Google.Cloud.Spanner.Data

Assembly

Google.Cloud.Spanner.Data.dll

Properties

BeginAt

public Key BeginAt { get; }

The start of the key range. It can be inclusive or exclusive, depending on the value of BeginInclusive.

Property Value
TypeDescription
Key

BeginInclusive

public bool BeginInclusive { get; }

True if the start of the key range is inclusive, and false otherwise.

Property Value
TypeDescription
Boolean

End

public Key End { get; }

The end of the key range. It can be inclusive or exclusive, depending on the value of EndInclusive.

Property Value
TypeDescription
Key

EndInclusive

public bool EndInclusive { get; }

True if the end of the key range is inclusive, and false if the end is exclusive.

Property Value
TypeDescription
Boolean

Methods

ClosedClosed(Key, Key)

public static KeyRange ClosedClosed(Key begin, Key end)

Creates a new KeyRange with an inclusive begin and inclusive end.

Parameters
NameDescription
beginKey

The begin of the key range (inclusive)

endKey

The end of the key range (inclusive)

Returns
TypeDescription
KeyRange

A new KeyRange for the keys [begin, end]

ClosedOpen(Key, Key)

public static KeyRange ClosedOpen(Key begin, Key end)

Creates a new KeyRange with an inclusive begin and exclusive end.

Parameters
NameDescription
beginKey

The begin of the key range (inclusive)

endKey

The end of the key range (exclusive)

Returns
TypeDescription
KeyRange

A new KeyRange for the keys [begin, end)

OpenClosed(Key, Key)

public static KeyRange OpenClosed(Key begin, Key end)

Creates a new KeyRange with an exclusive begin and inclusive end.

Parameters
NameDescription
beginKey

The begin of the key range (exclusive)

endKey

The end of the key range (inclusive)

Returns
TypeDescription
KeyRange

A new KeyRange for the keys (begin, end]

OpenOpen(Key, Key)

public static KeyRange OpenOpen(Key begin, Key end)

Creates a new KeyRange with an exclusive begin and exclusive end.

Parameters
NameDescription
beginKey

The begin of the key range (exclusive)

endKey

The end of the key range (exclusive)

Returns
TypeDescription
KeyRange

A new KeyRange for the keys (begin, end)

ToString(SpannerConnectionStringBuilder)

public string ToString(SpannerConnectionStringBuilder builder)

Returns the string representation of this KeyRange using the type conversion options specified in SpannerConnectionStringBuilder. The string representation is only for diagnostic purposes and the implementation may change over time.

Parameter
NameDescription
builderSpannerConnectionStringBuilder

The SpannerConnectionStringBuilder instance.

Returns
TypeDescription
String

A string that represents the current KeyRange.