models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: AGPL-3.0 Imports: 16 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 {
	Vendordb string
}{
	Vendordb: "vendordb",
}
View Source
var VendordbColumns = struct {
	Mac          string
	Vendor       string
	Registry     string
	Organization string
	Address      string
	Visibility   string
}{
	Mac:          "mac",
	Vendor:       "vendor",
	Registry:     "registry",
	Organization: "organization",
	Address:      "address",
	Visibility:   "visibility",
}
View Source
var VendordbRels = struct {
}{}

VendordbRels is where relationship names are stored.

View Source
var VendordbWhere = struct {
	Mac          whereHelperint64
	Vendor       whereHelpernull_String
	Registry     whereHelperstring
	Organization whereHelpernull_String
	Address      whereHelpernull_String
	Visibility   whereHelperint64
}{
	Mac:          whereHelperint64{/* contains filtered or unexported fields */},
	Vendor:       whereHelpernull_String{/* contains filtered or unexported fields */},
	Registry:     whereHelperstring{/* contains filtered or unexported fields */},
	Organization: whereHelpernull_String{/* contains filtered or unexported fields */},
	Address:      whereHelpernull_String{/* contains filtered or unexported fields */},
	Visibility:   whereHelperint64{/* contains filtered or unexported fields */},
}

Functions

func AddVendordbHook

func AddVendordbHook(hookPoint boil.HookPoint, vendordbHook VendordbHook)

AddVendordbHook 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 VendordbExists

func VendordbExists(ctx context.Context, exec boil.ContextExecutor, mac int64) (bool, error)

VendordbExists checks if the Vendordb row exists.

func Vendordbs

func Vendordbs(mods ...qm.QueryMod) vendordbQuery

Vendordbs 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 Vendordb

type Vendordb struct {
	Mac          int64       `boil:"mac" json:"mac" toml:"mac" yaml:"mac"`
	Vendor       null.String `boil:"vendor" json:"vendor,omitempty" toml:"vendor" yaml:"vendor,omitempty"`
	Registry     string      `boil:"registry" json:"registry" toml:"registry" yaml:"registry"`
	Organization null.String `boil:"organization" json:"organization,omitempty" toml:"organization" yaml:"organization,omitempty"`
	Address      null.String `boil:"address" json:"address,omitempty" toml:"address" yaml:"address,omitempty"`
	Visibility   int64       `boil:"visibility" json:"visibility" toml:"visibility" yaml:"visibility"`

	R *vendordbR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L vendordbL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Vendordb is an object representing the database table.

func FindVendordb

func FindVendordb(ctx context.Context, exec boil.ContextExecutor, mac int64, selectCols ...string) (*Vendordb, error)

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

func (*Vendordb) Delete

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

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

func (*Vendordb) Insert

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

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

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

func (*Vendordb) Update

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

Update uses an executor to update the Vendordb. 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.

type VendordbHook

type VendordbHook func(context.Context, boil.ContextExecutor, *Vendordb) error

VendordbHook is the signature for custom Vendordb hook methods

type VendordbSlice

type VendordbSlice []*Vendordb

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

func (VendordbSlice) DeleteAll

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

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

func (*VendordbSlice) ReloadAll

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

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