models

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 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 TableNames = struct {
	Tasks string
}{
	Tasks: "tasks",
}
View Source
var TaskColumns = struct {
	ID         string
	Name       string
	CheckValid string
}{
	ID:         "id",
	Name:       "name",
	CheckValid: "check_valid",
}
View Source
var TaskRels = struct {
}{}

TaskRels is where relationship names are stored.

View Source
var TaskTableColumns = struct {
	ID         string
	Name       string
	CheckValid string
}{
	ID:         "tasks.id",
	Name:       "tasks.name",
	CheckValid: "tasks.check_valid",
}
View Source
var TaskWhere = struct {
	ID         whereHelperint
	Name       whereHelperstring
	CheckValid whereHelperbool
}{
	ID:         whereHelperint{/* contains filtered or unexported fields */},
	Name:       whereHelperstring{/* contains filtered or unexported fields */},
	CheckValid: whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddTaskHook

func AddTaskHook(hookPoint boil.HookPoint, taskHook TaskHook)

AddTaskHook registers your hook function for all future operations.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func TaskExists

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

TaskExists checks if the Task row exists.

func Tasks

func Tasks(mods ...qm.QueryMod) taskQuery

Tasks retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

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

type Task

type Task struct {
	ID         int    `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name       string `boil:"name" json:"name" toml:"name" yaml:"name"`
	CheckValid bool   `boil:"check_valid" json:"check_valid" toml:"check_valid" yaml:"check_valid"`

	R *taskR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L taskL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Task is an object representing the database table.

func FindTask

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

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

func (*Task) Delete

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

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

func (*Task) Insert

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

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

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

func (*Task) Update

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

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

func (o *Task) 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 TaskHook

type TaskHook func(context.Context, boil.ContextExecutor, *Task) error

TaskHook is the signature for custom Task hook methods

type TaskSlice

type TaskSlice []*Task

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

func (TaskSlice) DeleteAll

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

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

func (*TaskSlice) ReloadAll

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

func (o TaskSlice) 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