models

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var KvstoreColumns = struct {
	Member string
	Key    string
	Value  string
	Nonce  string
}{
	Member: "member",
	Key:    "key",
	Value:  "value",
	Nonce:  "nonce",
}
View Source
var KvstoreRels = struct {
}{}

KvstoreRels is where relationship names are stored.

View Source
var KvstoreWhere = struct {
	Member whereHelperstring
	Key    whereHelperstring
	Value  whereHelper__byte
	Nonce  whereHelper__byte
}{
	Member: whereHelperstring{/* contains filtered or unexported fields */},
	Key:    whereHelperstring{/* contains filtered or unexported fields */},
	Value:  whereHelper__byte{/* contains filtered or unexported fields */},
	Nonce:  whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Kvstore string
}{
	Kvstore: "kvstore",
}

Functions

func AddKvstoreHook

func AddKvstoreHook(hookPoint boil.HookPoint, kvstoreHook KvstoreHook)

AddKvstoreHook registers your hook function for all future operations.

func KvstoreExists

func KvstoreExists(ctx context.Context, exec boil.ContextExecutor, member string, key string) (bool, error)

KvstoreExists checks if the Kvstore row exists.

func Kvstores

func Kvstores(mods ...qm.QueryMod) kvstoreQuery

Kvstores retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

Types

type Kvstore

type Kvstore struct {
	Member string `boil:"member" json:"member" toml:"member" yaml:"member"`
	Key    string `boil:"key" json:"key" toml:"key" yaml:"key"`
	Value  []byte `boil:"value" json:"value" toml:"value" yaml:"value"`
	Nonce  []byte `boil:"nonce" json:"nonce" toml:"nonce" yaml:"nonce"`

	R *kvstoreR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L kvstoreL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Kvstore is an object representing the database table.

func FindKvstore

func FindKvstore(ctx context.Context, exec boil.ContextExecutor, member string, key string, selectCols ...string) (*Kvstore, error)

FindKvstore retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Kvstore) Delete

func (o *Kvstore) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Kvstore record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Kvstore) Insert

func (o *Kvstore) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Kvstore) Reload

func (o *Kvstore) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Kvstore) Update

func (o *Kvstore) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Kvstore. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Kvstore) Upsert

func (o *Kvstore) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type KvstoreHook

type KvstoreHook func(context.Context, boil.ContextExecutor, *Kvstore) error

KvstoreHook is the signature for custom Kvstore hook methods

type KvstoreSlice

type KvstoreSlice []*Kvstore

KvstoreSlice is an alias for a slice of pointers to Kvstore. This should generally be used opposed to []Kvstore.

func (KvstoreSlice) DeleteAll

func (o KvstoreSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*KvstoreSlice) ReloadAll

func (o *KvstoreSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (KvstoreSlice) UpdateAll

func (o KvstoreSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

Jump to

Keyboard shortcuts

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