Documentation ¶
Index ¶
- func BuildQuery(queryAction *executorpb.QueryAction) (spanner.Statement, error)
- func ConvertSpannerRow(row *spanner.Row) (*executorpb.ValueList, *sppb.StructType, error)
- func ErrToStatus(e error) *spb.Status
- func ExecutorValueToSpannerValue(t *spannerpb.Type, v *executorpb.Value, null bool) (any, error)
- func KeySetProtoToCloudKeySet(keySetProto *executorpb.KeySet, typeList []*spannerpb.Type) (spanner.KeySet, error)
- type TableMetadataHelper
- func (t *TableMetadataHelper) GetColumnType(tableName string, colName string) (*spannerpb.Type, error)
- func (t *TableMetadataHelper) GetKeyColumnTypes(tableName string) ([]*spannerpb.Type, error)
- func (t *TableMetadataHelper) InitFrom(a *executorpb.StartTransactionAction)
- func (t *TableMetadataHelper) InitFromTableMetadata(tables []*executorpb.TableMetadata)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildQuery ¶
func BuildQuery(queryAction *executorpb.QueryAction) (spanner.Statement, error)
BuildQuery constructs a spanner.Statement query and bind the params from the input executorpb.QueryAction.
func ConvertSpannerRow ¶
func ConvertSpannerRow(row *spanner.Row) (*executorpb.ValueList, *sppb.StructType, error)
ConvertSpannerRow takes a Cloud Spanner Row and translates it to executorpb.ValueList and sppb.StructType. The result is always a struct, in which each value corresponds to a column of the Row.
func ExecutorValueToSpannerValue ¶
ExecutorValueToSpannerValue converts executorpb.Value with given spannerpb.Type into a cloud spanner interface. Parameter null indicates whether this value is NULL.
func KeySetProtoToCloudKeySet ¶
func KeySetProtoToCloudKeySet(keySetProto *executorpb.KeySet, typeList []*spannerpb.Type) (spanner.KeySet, error)
KeySetProtoToCloudKeySet converts executorpb.KeySet to spanner.KeySet.
Types ¶
type TableMetadataHelper ¶
type TableMetadataHelper struct {
// contains filtered or unexported fields
}
TableMetadataHelper is used to hold and retrieve metadata of tables and columns involved in a transaction.
func (*TableMetadataHelper) GetColumnType ¶
func (t *TableMetadataHelper) GetColumnType(tableName string, colName string) (*spannerpb.Type, error)
GetColumnType returns the column type of the given table and column.
func (*TableMetadataHelper) GetKeyColumnTypes ¶
func (t *TableMetadataHelper) GetKeyColumnTypes(tableName string) ([]*spannerpb.Type, error)
GetKeyColumnTypes returns a list of key column types of the given table.
func (*TableMetadataHelper) InitFrom ¶
func (t *TableMetadataHelper) InitFrom(a *executorpb.StartTransactionAction)
InitFrom reads table metadata from the given StartTransactionAction.
func (*TableMetadataHelper) InitFromTableMetadata ¶
func (t *TableMetadataHelper) InitFromTableMetadata(tables []*executorpb.TableMetadata)
InitFromTableMetadata extracts table metadata and make maps to store them.