models

package
v0.0.0-...-1e637f1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComicColumns = struct {
	ID        string
	Num       string
	HashID    string
	FP        string
	Title     string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Num:       "num",
	HashID:    "hash_id",
	FP:        "fp",
	Title:     "title",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var ComicRels = struct {
}{}

ComicRels is where relationship names are stored.

View Source
var ComicWhere = struct {
	ID        whereHelperint64
	Num       whereHelpernull_Int
	HashID    whereHelperstring
	FP        whereHelperstring
	Title     whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Num:       whereHelpernull_Int{/* contains filtered or unexported fields */},
	HashID:    whereHelperstring{/* contains filtered or unexported fields */},
	FP:        whereHelperstring{/* contains filtered or unexported fields */},
	Title:     whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* 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 TableNames = struct {
	Comics string
}{
	Comics: "comics",
}

Functions

func ComicExists

func ComicExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

ComicExists checks if the Comic row exists.

func Comics

func Comics(mods ...qm.QueryMod) comicQuery

Comics 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 Comic

type Comic struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	Num       null.Int  `boil:"num" json:"num,omitempty" toml:"num" yaml:"num,omitempty"`
	HashID    string    `boil:"hash_id" json:"hash_id" toml:"hash_id" yaml:"hash_id"`
	FP        string    `boil:"fp" json:"fp" toml:"fp" yaml:"fp"`
	Title     string    `boil:"title" json:"title" toml:"title" yaml:"title"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *comicR `boil:"m" json:"m" toml:"m" yaml:"m"`
	L comicL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Comic is an object representing the database table.

func FindComic

func FindComic(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Comic, error)

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

func (*Comic) Delete

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

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

func (*Comic) Insert

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

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

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

func (*Comic) Update

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

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

func (o *Comic) 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 ComicSlice

type ComicSlice []*Comic

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

func (ComicSlice) DeleteAll

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

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

func (*ComicSlice) ReloadAll

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

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