models

package
v0.0.0-...-9f01b0d Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-2.0 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 PortColumns = struct {
	UUID     string
	Key      string
	Name     string
	City     string
	Country  string
	Province string
	Timezone string
	Code     string
	Alias    string
	Regions  string
	Unlocs   string
	Xcoord   string
	Ycoord   string
}{
	UUID:     "uuid",
	Key:      "key",
	Name:     "name",
	City:     "city",
	Country:  "country",
	Province: "province",
	Timezone: "timezone",
	Code:     "code",
	Alias:    "alias",
	Regions:  "regions",
	Unlocs:   "unlocs",
	Xcoord:   "xcoord",
	Ycoord:   "ycoord",
}
View Source
var PortRels = struct {
}{}

PortRels is where relationship names are stored.

View Source
var PortWhere = struct {
	UUID     whereHelperstring
	Key      whereHelperstring
	Name     whereHelpernull_String
	City     whereHelpernull_String
	Country  whereHelpernull_String
	Province whereHelpernull_String
	Timezone whereHelpernull_String
	Code     whereHelpernull_String
	Alias    whereHelpertypes_StringArray
	Regions  whereHelpertypes_StringArray
	Unlocs   whereHelpertypes_StringArray
	Xcoord   whereHelpernull_String
	Ycoord   whereHelpernull_String
}{
	UUID:     whereHelperstring{/* contains filtered or unexported fields */},
	Key:      whereHelperstring{/* contains filtered or unexported fields */},
	Name:     whereHelpernull_String{/* contains filtered or unexported fields */},
	City:     whereHelpernull_String{/* contains filtered or unexported fields */},
	Country:  whereHelpernull_String{/* contains filtered or unexported fields */},
	Province: whereHelpernull_String{/* contains filtered or unexported fields */},
	Timezone: whereHelpernull_String{/* contains filtered or unexported fields */},
	Code:     whereHelpernull_String{/* contains filtered or unexported fields */},
	Alias:    whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Regions:  whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Unlocs:   whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Xcoord:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Ycoord:   whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Ports string
}{
	Ports: "ports",
}

Functions

func AddPortHook

func AddPortHook(hookPoint boil.HookPoint, portHook PortHook)

AddPortHook 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 PortExists

func PortExists(ctx context.Context, exec boil.ContextExecutor, uUID string) (bool, error)

PortExists checks if the Port row exists.

func Ports

func Ports(mods ...qm.QueryMod) portQuery

Ports 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 Port

type Port struct {
	UUID     string            `boil:"uuid" json:"uuid" toml:"uuid" yaml:"uuid"`
	Key      string            `boil:"key" json:"key" toml:"key" yaml:"key"`
	Name     null.String       `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	City     null.String       `boil:"city" json:"city,omitempty" toml:"city" yaml:"city,omitempty"`
	Country  null.String       `boil:"country" json:"country,omitempty" toml:"country" yaml:"country,omitempty"`
	Province null.String       `boil:"province" json:"province,omitempty" toml:"province" yaml:"province,omitempty"`
	Timezone null.String       `boil:"timezone" json:"timezone,omitempty" toml:"timezone" yaml:"timezone,omitempty"`
	Code     null.String       `boil:"code" json:"code,omitempty" toml:"code" yaml:"code,omitempty"`
	Alias    types.StringArray `boil:"alias" json:"alias,omitempty" toml:"alias" yaml:"alias,omitempty"`
	Regions  types.StringArray `boil:"regions" json:"regions,omitempty" toml:"regions" yaml:"regions,omitempty"`
	Unlocs   types.StringArray `boil:"unlocs" json:"unlocs,omitempty" toml:"unlocs" yaml:"unlocs,omitempty"`
	Xcoord   null.String       `boil:"xcoord" json:"xcoord,omitempty" toml:"xcoord" yaml:"xcoord,omitempty"`
	Ycoord   null.String       `boil:"ycoord" json:"ycoord,omitempty" toml:"ycoord" yaml:"ycoord,omitempty"`

	R *portR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L portL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Port is an object representing the database table.

func FindPort

func FindPort(ctx context.Context, exec boil.ContextExecutor, uUID string, selectCols ...string) (*Port, error)

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

func (*Port) Delete

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

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

func (*Port) Insert

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

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

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

func (*Port) Update

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

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

func (o *Port) 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 PortHook

type PortHook func(context.Context, boil.ContextExecutor, *Port) error

PortHook is the signature for custom Port hook methods

type PortSlice

type PortSlice []*Port

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

func (PortSlice) DeleteAll

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

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

func (*PortSlice) ReloadAll

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

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