models

package
v0.0.0-...-7a3a1f4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DummyColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
	Text      string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
	Text:      "text",
}
View Source
var DummyRels = struct {
}{}

DummyRels is where relationship names are stored.

View Source
var DummyWhere = struct {
	ID        whereHelperuint
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
	Text      whereHelpernull_String
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Text:      whereHelpernull_String{/* contains filtered or unexported fields */},
}
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 MigrationColumns = struct {
	ID        string
	CreatedAt string
	Name      string
}{
	ID:        "id",
	CreatedAt: "created_at",
	Name:      "name",
}
View Source
var MigrationRels = struct {
}{}

MigrationRels is where relationship names are stored.

View Source
var MigrationWhere = struct {
	ID        whereHelperuint
	CreatedAt whereHelpernull_Time
	Name      whereHelperstring
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Dummy      string
	Migrations string
}{
	Dummy:      "dummy",
	Migrations: "migrations",
}

Functions

func AddDummyHook

func AddDummyHook(hookPoint boil.HookPoint, dummyHook DummyHook)

AddDummyHook registers your hook function for all future operations.

func AddMigrationHook

func AddMigrationHook(hookPoint boil.HookPoint, migrationHook MigrationHook)

AddMigrationHook registers your hook function for all future operations.

func Dummies

func Dummies(mods ...qm.QueryMod) dummyQuery

Dummies retrieves all the records using an executor.

func DummyExists

func DummyExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

DummyExists checks if the Dummy row exists.

func MigrationExists

func MigrationExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

MigrationExists checks if the Migration row exists.

func Migrations

func Migrations(mods ...qm.QueryMod) migrationQuery

Migrations 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 Dummy

type Dummy struct {
	ID        uint        `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	DeletedAt null.Time   `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`
	Text      null.String `boil:"text" json:"text,omitempty" toml:"text" yaml:"text,omitempty"`

	R *dummyR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L dummyL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Dummy is an object representing the database table.

func FindDummy

func FindDummy(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Dummy, error)

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

func (*Dummy) Delete

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

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

func (*Dummy) Insert

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

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

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

func (*Dummy) Update

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

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

func (o *Dummy) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 DummyHook

type DummyHook func(context.Context, boil.ContextExecutor, *Dummy) error

DummyHook is the signature for custom Dummy hook methods

type DummySlice

type DummySlice []*Dummy

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

func (DummySlice) DeleteAll

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

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

func (*DummySlice) ReloadAll

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

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

type Migration

type Migration struct {
	ID        uint      `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`

	R *migrationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L migrationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Migration is an object representing the database table.

func FindMigration

func FindMigration(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Migration, error)

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

func (*Migration) Delete

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

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

func (*Migration) Insert

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

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

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

func (*Migration) Update

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

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

func (o *Migration) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 MigrationHook

type MigrationHook func(context.Context, boil.ContextExecutor, *Migration) error

MigrationHook is the signature for custom Migration hook methods

type MigrationSlice

type MigrationSlice []*Migration

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

func (MigrationSlice) DeleteAll

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

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

func (*MigrationSlice) ReloadAll

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

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