models

package
v0.0.0-...-f98ffab Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 17 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 NameColumns = struct {
	Nconst             string
	PrimaryName        string
	BirthYear          string
	DeathYear          string
	PrimaryProfessions string
	KnownForTitles     string
}{
	Nconst:             "nconst",
	PrimaryName:        "primary_name",
	BirthYear:          "birth_year",
	DeathYear:          "death_year",
	PrimaryProfessions: "primary_professions",
	KnownForTitles:     "known_for_titles",
}
View Source
var NameRels = struct {
}{}

NameRels is where relationship names are stored.

View Source
var NameWhere = struct {
	Nconst             whereHelperstring
	PrimaryName        whereHelpernull_String
	BirthYear          whereHelpernull_String
	DeathYear          whereHelpernull_String
	PrimaryProfessions whereHelpertypes_StringArray
	KnownForTitles     whereHelpertypes_StringArray
}{
	Nconst:             whereHelperstring{/* contains filtered or unexported fields */},
	PrimaryName:        whereHelpernull_String{/* contains filtered or unexported fields */},
	BirthYear:          whereHelpernull_String{/* contains filtered or unexported fields */},
	DeathYear:          whereHelpernull_String{/* contains filtered or unexported fields */},
	PrimaryProfessions: whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	KnownForTitles:     whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Names string
}{
	Names: "names",
}

Functions

func AddNameHook

func AddNameHook(hookPoint boil.HookPoint, nameHook NameHook)

AddNameHook registers your hook function for all future operations.

func NameExists

func NameExists(ctx context.Context, exec boil.ContextExecutor, nconst string) (bool, error)

NameExists checks if the Name row exists.

func Names

func Names(mods ...qm.QueryMod) nameQuery

Names 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 M

type M map[string]interface{}

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

type Name

type Name struct {
	Nconst             string            `boil:"nconst" json:"nconst" toml:"nconst" yaml:"nconst"`
	PrimaryName        null.String       `boil:"primary_name" json:"primary_name,omitempty" toml:"primary_name" yaml:"primary_name,omitempty"`
	BirthYear          null.String       `boil:"birth_year" json:"birth_year,omitempty" toml:"birth_year" yaml:"birth_year,omitempty"`
	DeathYear          null.String       `boil:"death_year" json:"death_year,omitempty" toml:"death_year" yaml:"death_year,omitempty"`
	PrimaryProfessions types.StringArray `` /* 127-byte string literal not displayed */
	KnownForTitles     types.StringArray `boil:"known_for_titles" json:"known_for_titles,omitempty" toml:"known_for_titles" yaml:"known_for_titles,omitempty"`

	R *nameR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L nameL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Name is an object representing the database table.

func FindName

func FindName(ctx context.Context, exec boil.ContextExecutor, nconst string, selectCols ...string) (*Name, error)

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

func (*Name) Delete

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

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

func (*Name) Insert

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

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

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

func (*Name) Update

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

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

func (o *Name) 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 NameHook

type NameHook func(context.Context, boil.ContextExecutor, *Name) error

NameHook is the signature for custom Name hook methods

type NameSlice

type NameSlice []*Name

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

func (NameSlice) DeleteAll

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

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

func (*NameSlice) ReloadAll

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

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