models

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

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

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

Code generated by yo. DO NOT EDIT. Package models 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 added in v0.4.0

func CompositePrimaryKeyWritableColumns() []string

func FereignItemColumns added in v0.3.1

func FereignItemColumns() []string

func FereignItemPrimaryKeys added in v0.3.1

func FereignItemPrimaryKeys() []string

func FereignItemWritableColumns added in v0.4.0

func FereignItemWritableColumns() []string

func FullTypeColumns

func FullTypeColumns() []string

func FullTypePrimaryKeys

func FullTypePrimaryKeys() []string

func FullTypeWritableColumns added in v0.4.0

func FullTypeWritableColumns() []string

func GeneratedColumnColumns added in v0.4.0

func GeneratedColumnColumns() []string

func GeneratedColumnPrimaryKeys added in v0.4.0

func GeneratedColumnPrimaryKeys() []string

func GeneratedColumnWritableColumns added in v0.4.0

func GeneratedColumnWritableColumns() []string

func ItemColumns added in v0.3.1

func ItemColumns() []string

func ItemPrimaryKeys added in v0.3.1

func ItemPrimaryKeys() []string

func ItemWritableColumns added in v0.4.0

func ItemWritableColumns() []string

func MaxLengthColumns

func MaxLengthColumns() []string

func MaxLengthPrimaryKeys

func MaxLengthPrimaryKeys() []string

func MaxLengthWritableColumns added in v0.4.0

func MaxLengthWritableColumns() []string

func OutOfOrderPrimaryKeyColumns added in v0.3.2

func OutOfOrderPrimaryKeyColumns() []string

func OutOfOrderPrimaryKeyPrimaryKeys added in v0.3.2

func OutOfOrderPrimaryKeyPrimaryKeys() []string

func OutOfOrderPrimaryKeyWritableColumns added in v0.4.0

func OutOfOrderPrimaryKeyWritableColumns() []string

func SnakeCaseColumns

func SnakeCaseColumns() []string

func SnakeCasePrimaryKeys

func SnakeCasePrimaryKeys() []string

func SnakeCaseWritableColumns added in v0.4.0

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 added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

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 retrieve 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 added in v0.2.0

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 retrieve 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 added in v0.2.0

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 retrieve 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 added in v0.2.0

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 retrieve 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 added in v0.3.1

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 added in v0.3.1

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

FindFereignItem gets a FereignItem by primary key

func ReadFereignItem added in v0.3.1

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 added in v0.3.1

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

Delete deletes the FereignItem from the database.

func (*FereignItem) Insert added in v0.3.1

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 added in v0.3.1

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 added in v0.3.1

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 added in v0.3.1

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 added in v0.3.0

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 added in v0.3.0

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 added in v0.2.0

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 added in v0.2.0

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 retrieve 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 added in v0.3.0

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 retrieve 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 added in v0.2.0

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 retrieve 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 added in v0.3.0

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 retrieve 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 added in v0.2.0

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 retrieve 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 added in v0.4.0

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 added in v0.4.0

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

FindGeneratedColumn gets a GeneratedColumn by primary key

func ReadGeneratedColumn added in v0.4.0

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 added in v0.4.0

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

Delete deletes the GeneratedColumn from the database.

func (*GeneratedColumn) Insert added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.3.1

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 added in v0.3.1

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

FindItem gets a Item by primary key

func ReadItem added in v0.3.1

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 added in v0.3.1

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

Delete deletes the Item from the database.

func (*Item) Insert added in v0.3.1

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 added in v0.3.1

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 added in v0.3.1

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 added in v0.3.1

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 added in v0.2.0

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 added in v0.3.2

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 added in v0.3.2

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

Delete deletes the OutOfOrderPrimaryKey from the database.

func (*OutOfOrderPrimaryKey) Insert added in v0.3.2

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 added in v0.2.0

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 added in v0.2.0

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 retrieve 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