Documentation ¶
Overview ¶
Code generated by yo. DO NOT EDIT. Package user contains the types.
Code generated by yo. DO NOT EDIT. Package user contains the types.
Index ¶
- Variables
- func UserColumns() []string
- func UserPrimaryKeys() []string
- func UserWritableColumns() []string
- type User
- func (u *User) Delete(ctx context.Context) *spanner.Mutation
- func (u *User) Insert(ctx context.Context) *spanner.Mutation
- func (u *User) InsertOrUpdate(ctx context.Context) *spanner.Mutation
- func (u *User) Update(ctx context.Context) *spanner.Mutation
- func (u *User) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)
- type YODB
- type YORODB
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 UserColumns ¶
func UserColumns() []string
func UserPrimaryKeys ¶
func UserPrimaryKeys() []string
func UserWritableColumns ¶
func UserWritableColumns() []string
Types ¶
type User ¶
type User struct { ID string `spanner:"Id" json:"Id"` // Id Name string `spanner:"Name" json:"Name"` // Name Email string `spanner:"Email" json:"Email"` // Email CreatedAt time.Time `spanner:"CreatedAt" json:"CreatedAt"` // CreatedAt UpdatedAt time.Time `spanner:"UpdatedAt" json:"UpdatedAt"` // UpdatedAt }
User represents a row from 'Users'.
func (*User) Insert ¶
Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.
func (*User) InsertOrUpdate ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.