single

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Code generated by yo. DO NOT EDIT. Package single contains the types.

Index

Constants

This section is empty.

Variables

View Source
var YOLog = func(context.Context, string, ...interface{}) {}

YOLog provides the log func used by generated queries.

Functions

func CompositePrimaryKeyColumns

func CompositePrimaryKeyColumns() []string

func CompositePrimaryKeyPrimaryKeys

func CompositePrimaryKeyPrimaryKeys() []string

func CompositePrimaryKeyWritableColumns

func CompositePrimaryKeyWritableColumns() []string

func FereignItemColumns

func FereignItemColumns() []string

func FereignItemPrimaryKeys

func FereignItemPrimaryKeys() []string

func FereignItemWritableColumns

func FereignItemWritableColumns() []string

func FullTypeColumns

func FullTypeColumns() []string

func FullTypePrimaryKeys

func FullTypePrimaryKeys() []string

func FullTypeWritableColumns

func FullTypeWritableColumns() []string

func GeneratedColumnColumns

func GeneratedColumnColumns() []string

func GeneratedColumnPrimaryKeys

func GeneratedColumnPrimaryKeys() []string

func GeneratedColumnWritableColumns

func GeneratedColumnWritableColumns() []string

func ItemColumns

func ItemColumns() []string

func ItemPrimaryKeys

func ItemPrimaryKeys() []string

func ItemWritableColumns

func ItemWritableColumns() []string

func MaxLengthColumns

func MaxLengthColumns() []string

func MaxLengthPrimaryKeys

func MaxLengthPrimaryKeys() []string

func MaxLengthWritableColumns

func MaxLengthWritableColumns() []string

func OutOfOrderPrimaryKeyColumns

func OutOfOrderPrimaryKeyColumns() []string

func OutOfOrderPrimaryKeyPrimaryKeys

func OutOfOrderPrimaryKeyPrimaryKeys() []string

func OutOfOrderPrimaryKeyWritableColumns

func OutOfOrderPrimaryKeyWritableColumns() []string

func SnakeCaseColumns

func SnakeCaseColumns() []string

func SnakeCasePrimaryKeys

func SnakeCasePrimaryKeys() []string

func SnakeCaseWritableColumns

func SnakeCaseWritableColumns() []string

Types

type CompositePrimaryKey

type CompositePrimaryKey struct {
	ID    int64  `spanner:"Id" json:"Id"`       // Id
	PKey1 string `spanner:"PKey1" json:"PKey1"` // PKey1
	PKey2 int64  `spanner:"PKey2" json:"PKey2"` // PKey2
	Error int64  `spanner:"Error" json:"Error"` // Error
	X     string `spanner:"X" json:"X"`         // X
	Y     string `spanner:"Y" json:"Y"`         // Y
	Z     string `spanner:"Z" json:"Z"`         // Z
}

CompositePrimaryKey represents a row from 'CompositePrimaryKeys'.

func FindCompositePrimaryKey

func FindCompositePrimaryKey(ctx context.Context, db YORODB, pKey1 string, pKey2 int64) (*CompositePrimaryKey, error)

FindCompositePrimaryKey gets a CompositePrimaryKey by primary key

func FindCompositePrimaryKeysByError

func FindCompositePrimaryKeysByError(ctx context.Context, db YORODB, e int64) ([]*CompositePrimaryKey, error)

FindCompositePrimaryKeysByError retrieves multiple rows from 'CompositePrimaryKeys' as a slice of CompositePrimaryKey.

Generated from index 'CompositePrimaryKeysByError'.

func FindCompositePrimaryKeysByXY

func FindCompositePrimaryKeysByXY(ctx context.Context, db YORODB, x string, y string) ([]*CompositePrimaryKey, error)

FindCompositePrimaryKeysByXY retrieves multiple rows from 'CompositePrimaryKeys' as a slice of CompositePrimaryKey.

Generated from index 'CompositePrimaryKeysByXY'.

func FindCompositePrimaryKeysByZError

func FindCompositePrimaryKeysByZError(ctx context.Context, db YORODB, e int64) ([]*CompositePrimaryKey, error)

FindCompositePrimaryKeysByZError retrieves multiple rows from 'CompositePrimaryKeys' as a slice of CompositePrimaryKey.

Generated from index 'CompositePrimaryKeysByError2'.

func FindCompositePrimaryKeysByZYError

func FindCompositePrimaryKeysByZYError(ctx context.Context, db YORODB, e int64) ([]*CompositePrimaryKey, error)

FindCompositePrimaryKeysByZYError retrieves multiple rows from 'CompositePrimaryKeys' as a slice of CompositePrimaryKey.

Generated from index 'CompositePrimaryKeysByError3'.

func ReadCompositePrimaryKey

func ReadCompositePrimaryKey(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*CompositePrimaryKey, error)

ReadCompositePrimaryKey retrieves multiples rows from CompositePrimaryKey by KeySet as a slice.

func ReadCompositePrimaryKeysByError

func ReadCompositePrimaryKeysByError(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*CompositePrimaryKey, error)

ReadCompositePrimaryKeysByError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice.

This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'CompositePrimaryKeysByError'.

func ReadCompositePrimaryKeysByXY

func ReadCompositePrimaryKeysByXY(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*CompositePrimaryKey, error)

ReadCompositePrimaryKeysByXY retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice.

This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'CompositePrimaryKeysByXY'.

func ReadCompositePrimaryKeysByZError

func ReadCompositePrimaryKeysByZError(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*CompositePrimaryKey, error)

ReadCompositePrimaryKeysByZError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice.

This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'CompositePrimaryKeysByError2'.

func ReadCompositePrimaryKeysByZYError

func ReadCompositePrimaryKeysByZYError(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*CompositePrimaryKey, error)

ReadCompositePrimaryKeysByZYError retrieves multiples rows from 'CompositePrimaryKeys' by KeySet as a slice.

This does not retrives all columns of 'CompositePrimaryKeys' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'CompositePrimaryKeysByError3'.

func (*CompositePrimaryKey) Delete

Delete deletes the CompositePrimaryKey from the database.

func (*CompositePrimaryKey) Insert

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*CompositePrimaryKey) InsertOrUpdate

func (cpk *CompositePrimaryKey) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*CompositePrimaryKey) Update

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*CompositePrimaryKey) UpdateColumns

func (cpk *CompositePrimaryKey) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type FereignItem

type FereignItem struct {
	ID       int64 `spanner:"ID" json:"ID"`             // ID
	ItemID   int64 `spanner:"ItemID" json:"ItemID"`     // ItemID
	Category int64 `spanner:"Category" json:"Category"` // Category
}

FereignItem represents a row from 'FereignItems'.

func FindFereignItem

func FindFereignItem(ctx context.Context, db YORODB, id int64) (*FereignItem, error)

FindFereignItem gets a FereignItem by primary key

func ReadFereignItem

func ReadFereignItem(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FereignItem, error)

ReadFereignItem retrieves multiples rows from FereignItem by KeySet as a slice.

func (*FereignItem) Delete

func (fi *FereignItem) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the FereignItem from the database.

func (*FereignItem) Insert

func (fi *FereignItem) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*FereignItem) InsertOrUpdate

func (fi *FereignItem) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*FereignItem) Update

func (fi *FereignItem) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*FereignItem) UpdateColumns

func (fi *FereignItem) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type FullType

type FullType struct {
	PKey                 string              `spanner:"PKey" json:"PKey"`                                 // PKey
	FTString             string              `spanner:"FTString" json:"FTString"`                         // FTString
	FTStringNull         spanner.NullString  `spanner:"FTStringNull" json:"FTStringNull"`                 // FTStringNull
	FTBool               bool                `spanner:"FTBool" json:"FTBool"`                             // FTBool
	FTBoolNull           spanner.NullBool    `spanner:"FTBoolNull" json:"FTBoolNull"`                     // FTBoolNull
	FTBytes              []byte              `spanner:"FTBytes" json:"FTBytes"`                           // FTBytes
	FTBytesNull          []byte              `spanner:"FTBytesNull" json:"FTBytesNull"`                   // FTBytesNull
	FTTimestamp          time.Time           `spanner:"FTTimestamp" json:"FTTimestamp"`                   // FTTimestamp
	FTTimestampNull      spanner.NullTime    `spanner:"FTTimestampNull" json:"FTTimestampNull"`           // FTTimestampNull
	FTInt                int64               `spanner:"FTInt" json:"FTInt"`                               // FTInt
	FTIntNull            spanner.NullInt64   `spanner:"FTIntNull" json:"FTIntNull"`                       // FTIntNull
	FTFloat              float64             `spanner:"FTFloat" json:"FTFloat"`                           // FTFloat
	FTFloatNull          spanner.NullFloat64 `spanner:"FTFloatNull" json:"FTFloatNull"`                   // FTFloatNull
	FTDate               civil.Date          `spanner:"FTDate" json:"FTDate"`                             // FTDate
	FTDateNull           spanner.NullDate    `spanner:"FTDateNull" json:"FTDateNull"`                     // FTDateNull
	FTJSON               spanner.NullJSON    `spanner:"FTJson" json:"FTJson"`                             // FTJson
	FTJSONNull           spanner.NullJSON    `spanner:"FTJsonNull" json:"FTJsonNull"`                     // FTJsonNull
	FTArrayStringNull    []string            `spanner:"FTArrayStringNull" json:"FTArrayStringNull"`       // FTArrayStringNull
	FTArrayString        []string            `spanner:"FTArrayString" json:"FTArrayString"`               // FTArrayString
	FTArrayBoolNull      []bool              `spanner:"FTArrayBoolNull" json:"FTArrayBoolNull"`           // FTArrayBoolNull
	FTArrayBool          []bool              `spanner:"FTArrayBool" json:"FTArrayBool"`                   // FTArrayBool
	FTArrayBytesNull     [][]byte            `spanner:"FTArrayBytesNull" json:"FTArrayBytesNull"`         // FTArrayBytesNull
	FTArrayBytes         [][]byte            `spanner:"FTArrayBytes" json:"FTArrayBytes"`                 // FTArrayBytes
	FTArrayTimestampNull []time.Time         `spanner:"FTArrayTimestampNull" json:"FTArrayTimestampNull"` // FTArrayTimestampNull
	FTArrayTimestamp     []time.Time         `spanner:"FTArrayTimestamp" json:"FTArrayTimestamp"`         // FTArrayTimestamp
	FTArrayIntNull       []int64             `spanner:"FTArrayIntNull" json:"FTArrayIntNull"`             // FTArrayIntNull
	FTArrayInt           []int64             `spanner:"FTArrayInt" json:"FTArrayInt"`                     // FTArrayInt
	FTArrayFloatNull     []float64           `spanner:"FTArrayFloatNull" json:"FTArrayFloatNull"`         // FTArrayFloatNull
	FTArrayFloat         []float64           `spanner:"FTArrayFloat" json:"FTArrayFloat"`                 // FTArrayFloat
	FTArrayDateNull      []civil.Date        `spanner:"FTArrayDateNull" json:"FTArrayDateNull"`           // FTArrayDateNull
	FTArrayDate          []civil.Date        `spanner:"FTArrayDate" json:"FTArrayDate"`                   // FTArrayDate
	FTArrayJSONNull      []spanner.NullJSON  `spanner:"FTArrayJsonNull" json:"FTArrayJsonNull"`           // FTArrayJsonNull
	FTArrayJSON          []spanner.NullJSON  `spanner:"FTArrayJson" json:"FTArrayJson"`                   // FTArrayJson
}

FullType represents a row from 'FullTypes'.

func FindFullType

func FindFullType(ctx context.Context, db YORODB, pKey string) (*FullType, error)

FindFullType gets a FullType by primary key

func FindFullTypeByFTString

func FindFullTypeByFTString(ctx context.Context, db YORODB, fTString string) (*FullType, error)

FindFullTypeByFTString retrieves a row from 'FullTypes' as a FullType.

If no row is present with the given key, then ReadRow returns an error where spanner.ErrCode(err) is codes.NotFound.

Generated from unique index 'FullTypesByFTString'.

func FindFullTypesByFTIntFTDate

func FindFullTypesByFTIntFTDate(ctx context.Context, db YORODB, fTInt int64, fTDate civil.Date) ([]*FullType, error)

FindFullTypesByFTIntFTDate retrieves multiple rows from 'FullTypes' as a slice of FullType.

Generated from index 'FullTypesByIntDate'.

func FindFullTypesByFTIntFTTimestamp

func FindFullTypesByFTIntFTTimestamp(ctx context.Context, db YORODB, fTInt int64, fTTimestamp time.Time) ([]*FullType, error)

FindFullTypesByFTIntFTTimestamp retrieves multiple rows from 'FullTypes' as a slice of FullType.

Generated from index 'FullTypesByIntTimestamp'.

func FindFullTypesByFTIntFTTimestampNull

func FindFullTypesByFTIntFTTimestampNull(ctx context.Context, db YORODB, fTInt int64, fTTimestampNull spanner.NullTime) ([]*FullType, error)

FindFullTypesByFTIntFTTimestampNull retrieves multiple rows from 'FullTypes' as a slice of FullType.

Generated from index 'FullTypesByInTimestampNull'.

func FindFullTypesByFTTimestamp

func FindFullTypesByFTTimestamp(ctx context.Context, db YORODB, fTTimestamp time.Time) ([]*FullType, error)

FindFullTypesByFTTimestamp retrieves multiple rows from 'FullTypes' as a slice of FullType.

Generated from index 'FullTypesByTimestamp'.

func ReadFullType

func ReadFullType(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullType retrieves multiples rows from FullType by KeySet as a slice.

func ReadFullTypeByFTString

func ReadFullTypeByFTString(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullTypeByFTString retrieves multiples rows from 'FullTypes' by KeySet as a slice.

This does not retrives all columns of 'FullTypes' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'FullTypesByFTString'.

func ReadFullTypesByFTIntFTDate

func ReadFullTypesByFTIntFTDate(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullTypesByFTIntFTDate retrieves multiples rows from 'FullTypes' by KeySet as a slice.

This does not retrives all columns of 'FullTypes' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'FullTypesByIntDate'.

func ReadFullTypesByFTIntFTTimestamp

func ReadFullTypesByFTIntFTTimestamp(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullTypesByFTIntFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice.

This does not retrives all columns of 'FullTypes' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'FullTypesByIntTimestamp'.

func ReadFullTypesByFTIntFTTimestampNull

func ReadFullTypesByFTIntFTTimestampNull(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullTypesByFTIntFTTimestampNull retrieves multiples rows from 'FullTypes' by KeySet as a slice.

This does not retrives all columns of 'FullTypes' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'FullTypesByInTimestampNull'.

func ReadFullTypesByFTTimestamp

func ReadFullTypesByFTTimestamp(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*FullType, error)

ReadFullTypesByFTTimestamp retrieves multiples rows from 'FullTypes' by KeySet as a slice.

This does not retrives all columns of 'FullTypes' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'FullTypesByTimestamp'.

func (*FullType) Delete

func (ft *FullType) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the FullType from the database.

func (*FullType) Insert

func (ft *FullType) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*FullType) InsertOrUpdate

func (ft *FullType) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*FullType) Update

func (ft *FullType) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*FullType) UpdateColumns

func (ft *FullType) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type GeneratedColumn

type GeneratedColumn struct {
	ID        int64  `spanner:"ID" json:"ID"`               // ID
	FirstName string `spanner:"FirstName" json:"FirstName"` // FirstName
	LastName  string `spanner:"LastName" json:"LastName"`   // LastName
	FullName  string `spanner:"FullName" json:"FullName"`   // FullName
}

GeneratedColumn represents a row from 'GeneratedColumns'.

func FindGeneratedColumn

func FindGeneratedColumn(ctx context.Context, db YORODB, id int64) (*GeneratedColumn, error)

FindGeneratedColumn gets a GeneratedColumn by primary key

func ReadGeneratedColumn

func ReadGeneratedColumn(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*GeneratedColumn, error)

ReadGeneratedColumn retrieves multiples rows from GeneratedColumn by KeySet as a slice.

func (*GeneratedColumn) Delete

func (gc *GeneratedColumn) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the GeneratedColumn from the database.

func (*GeneratedColumn) Insert

func (gc *GeneratedColumn) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*GeneratedColumn) InsertOrUpdate

func (gc *GeneratedColumn) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*GeneratedColumn) Update

func (gc *GeneratedColumn) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*GeneratedColumn) UpdateColumns

func (gc *GeneratedColumn) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type Item

type Item struct {
	ID    int64 `spanner:"ID" json:"ID"`       // ID
	Price int64 `spanner:"Price" json:"Price"` // Price
}

Item represents a row from 'Items'.

func FindItem

func FindItem(ctx context.Context, db YORODB, id int64) (*Item, error)

FindItem gets a Item by primary key

func ReadItem

func ReadItem(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*Item, error)

ReadItem retrieves multiples rows from Item by KeySet as a slice.

func (*Item) Delete

func (i *Item) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the Item from the database.

func (*Item) Insert

func (i *Item) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*Item) InsertOrUpdate

func (i *Item) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*Item) Update

func (i *Item) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*Item) UpdateColumns

func (i *Item) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type MaxLength

type MaxLength struct {
	MaxString string `spanner:"MaxString" json:"MaxString"` // MaxString
	MaxBytes  []byte `spanner:"MaxBytes" json:"MaxBytes"`   // MaxBytes
}

MaxLength represents a row from 'MaxLengths'.

func FindMaxLength

func FindMaxLength(ctx context.Context, db YORODB, maxString string) (*MaxLength, error)

FindMaxLength gets a MaxLength by primary key

func ReadMaxLength

func ReadMaxLength(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*MaxLength, error)

ReadMaxLength retrieves multiples rows from MaxLength by KeySet as a slice.

func (*MaxLength) Delete

func (ml *MaxLength) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the MaxLength from the database.

func (*MaxLength) Insert

func (ml *MaxLength) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*MaxLength) InsertOrUpdate

func (ml *MaxLength) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*MaxLength) Update

func (ml *MaxLength) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*MaxLength) UpdateColumns

func (ml *MaxLength) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type OutOfOrderPrimaryKey

type OutOfOrderPrimaryKey struct {
	PKey1 string `spanner:"PKey1" json:"PKey1"` // PKey1
	PKey2 string `spanner:"PKey2" json:"PKey2"` // PKey2
	PKey3 string `spanner:"PKey3" json:"PKey3"` // PKey3
}

OutOfOrderPrimaryKey represents a row from 'OutOfOrderPrimaryKeys'.

func (*OutOfOrderPrimaryKey) Delete

func (ooopk *OutOfOrderPrimaryKey) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the OutOfOrderPrimaryKey from the database.

func (*OutOfOrderPrimaryKey) Insert

func (ooopk *OutOfOrderPrimaryKey) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

type SnakeCase

type SnakeCase struct {
	ID        int64  `spanner:"id" json:"id"`                   // id
	StringID  string `spanner:"string_id" json:"string_id"`     // string_id
	FooBarBaz int64  `spanner:"foo_bar_baz" json:"foo_bar_baz"` // foo_bar_baz
}

SnakeCase represents a row from 'snake_cases'.

func FindSnakeCase

func FindSnakeCase(ctx context.Context, db YORODB, id int64) (*SnakeCase, error)

FindSnakeCase gets a SnakeCase by primary key

func FindSnakeCasesByStringIDFooBarBaz

func FindSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YORODB, stringID string, fooBarBaz int64) ([]*SnakeCase, error)

FindSnakeCasesByStringIDFooBarBaz retrieves multiple rows from 'snake_cases' as a slice of SnakeCase.

Generated from index 'snake_cases_by_string_id'.

func ReadSnakeCase

func ReadSnakeCase(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*SnakeCase, error)

ReadSnakeCase retrieves multiples rows from SnakeCase by KeySet as a slice.

func ReadSnakeCasesByStringIDFooBarBaz

func ReadSnakeCasesByStringIDFooBarBaz(ctx context.Context, db YORODB, keys spanner.KeySet) ([]*SnakeCase, error)

ReadSnakeCasesByStringIDFooBarBaz retrieves multiples rows from 'snake_cases' by KeySet as a slice.

This does not retrives all columns of 'snake_cases' because an index has only columns used for primary key, index key and storing columns. If you need more columns, add storing columns or Read by primary key or Query with join.

Generated from unique index 'snake_cases_by_string_id'.

func (*SnakeCase) Delete

func (sc *SnakeCase) Delete(ctx context.Context) *spanner.Mutation

Delete deletes the SnakeCase from the database.

func (*SnakeCase) Insert

func (sc *SnakeCase) Insert(ctx context.Context) *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*SnakeCase) InsertOrUpdate

func (sc *SnakeCase) InsertOrUpdate(ctx context.Context) *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*SnakeCase) Update

func (sc *SnakeCase) Update(ctx context.Context) *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*SnakeCase) UpdateColumns

func (sc *SnakeCase) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

type YODB

type YODB interface {
	YORODB
}

YODB is the common interface for database operations.

type YORODB

type YORODB interface {
	ReadRow(ctx context.Context, table string, key spanner.Key, columns []string) (*spanner.Row, error)
	Read(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator
	ReadUsingIndex(ctx context.Context, table, index string, keys spanner.KeySet, columns []string) (ri *spanner.RowIterator)
	Query(ctx context.Context, statement spanner.Statement) *spanner.RowIterator
}

YORODB is the common interface for database operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL