models

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT 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 MemoryColumns = struct {
	ID      string
	Author  string
	Content string
	Append  string
}{
	ID:      "id",
	Author:  "author",
	Content: "content",
	Append:  "append",
}
View Source
var MemoryRels = struct {
}{}

MemoryRels is where relationship names are stored.

View Source
var MemoryTableColumns = struct {
	ID      string
	Author  string
	Content string
	Append  string
}{
	ID:      "memories.id",
	Author:  "memories.author",
	Content: "memories.content",
	Append:  "memories.append",
}
View Source
var MemoryWhere = struct {
	ID      whereHelperint
	Author  whereHelperstring
	Content whereHelperstring
	Append  whereHelpertime_Time
}{
	ID:      whereHelperint{/* contains filtered or unexported fields */},
	Author:  whereHelperstring{/* contains filtered or unexported fields */},
	Content: whereHelperstring{/* contains filtered or unexported fields */},
	Append:  whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Memories string
}{
	Memories: "memories",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddMemoryHook

func AddMemoryHook(hookPoint boil.HookPoint, memoryHook MemoryHook)

AddMemoryHook registers your hook function for all future operations.

func Memories

func Memories(mods ...qm.QueryMod) memoryQuery

Memories retrieves all the records using an executor.

func MemoryExists

func MemoryExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

MemoryExists checks if the Memory row exists.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

Types

type M

type M map[string]interface{}

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

type Memory

type Memory struct {
	ID      int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	Author  string    `boil:"author" json:"author" toml:"author" yaml:"author"`
	Content string    `boil:"content" json:"content" toml:"content" yaml:"content"`
	Append  time.Time `boil:"append" json:"append" toml:"append" yaml:"append"`

	R *memoryR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L memoryL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Memory is an object representing the database table.

func FindMemory

func FindMemory(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Memory, error)

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

func (*Memory) Delete

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

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

func (*Memory) Insert

func (o *Memory) 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 (*Memory) Reload

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

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

func (*Memory) Update

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

Update uses an executor to update the Memory. 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 (*Memory) Upsert

func (o *Memory) 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 MemoryHook

type MemoryHook func(context.Context, boil.ContextExecutor, *Memory) error

MemoryHook is the signature for custom Memory hook methods

type MemorySlice

type MemorySlice []*Memory

MemorySlice is an alias for a slice of pointers to Memory. This should almost always be used instead of []Memory.

func (MemorySlice) DeleteAll

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

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

func (*MemorySlice) ReloadAll

func (o *MemorySlice) 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 (MemorySlice) UpdateAll

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

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

Jump to

Keyboard shortcuts

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