Class KeyRange
Immutable class that defines a range of keys to select from a table or index.
Namespace: Google.Cloud.Spanner.Data
Assembly: Google.Cloud.Spanner.Data.dll
Syntax
public sealed class KeyRange
Properties
BeginAt
The start of the key range. It can be inclusive or exclusive, depending on the value of BeginInclusive.
Declaration
public Key BeginAt { get; }
Property Value
Type | Description |
---|---|
Key |
BeginInclusive
True if the start of the key range is inclusive, and false otherwise.
Declaration
public bool BeginInclusive { get; }
Property Value
Type | Description |
---|---|
bool |
End
The end of the key range. It can be inclusive or exclusive, depending on the value of EndInclusive.
Declaration
public Key End { get; }
Property Value
Type | Description |
---|---|
Key |
EndInclusive
True if the end of the key range is inclusive, and false if the end is exclusive.
Declaration
public bool EndInclusive { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ClosedClosed(Key, Key)
Creates a new KeyRange with an inclusive begin and inclusive end.
Declaration
public static KeyRange ClosedClosed(Key begin, Key end)
Parameters
Type | Name | Description |
---|---|---|
Key | begin | The begin of the key range (inclusive) |
Key | end | The end of the key range (inclusive) |
Returns
Type | Description |
---|---|
KeyRange | A new KeyRange for the keys [begin, end] |
ClosedOpen(Key, Key)
Creates a new KeyRange with an inclusive begin and exclusive end.
Declaration
public static KeyRange ClosedOpen(Key begin, Key end)
Parameters
Type | Name | Description |
---|---|---|
Key | begin | The begin of the key range (inclusive) |
Key | end | The end of the key range (exclusive) |
Returns
Type | Description |
---|---|
KeyRange | A new KeyRange for the keys [begin, end) |
OpenClosed(Key, Key)
Creates a new KeyRange with an exclusive begin and inclusive end.
Declaration
public static KeyRange OpenClosed(Key begin, Key end)
Parameters
Type | Name | Description |
---|---|---|
Key | begin | The begin of the key range (exclusive) |
Key | end | The end of the key range (inclusive) |
Returns
Type | Description |
---|---|
KeyRange | A new KeyRange for the keys (begin, end] |
OpenOpen(Key, Key)
Creates a new KeyRange with an exclusive begin and exclusive end.
Declaration
public static KeyRange OpenOpen(Key begin, Key end)
Parameters
Type | Name | Description |
---|---|---|
Key | begin | The begin of the key range (exclusive) |
Key | end | The end of the key range (exclusive) |
Returns
Type | Description |
---|---|
KeyRange | A new KeyRange for the keys (begin, end) |
ToString(SpannerConnectionStringBuilder)
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.
Declaration
public string ToString(SpannerConnectionStringBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
SpannerConnectionStringBuilder | builder | The SpannerConnectionStringBuilder instance. |
Returns
Type | Description |
---|---|
string | A string that represents the current KeyRange. |