automodel

package
v0.0.0-...-35c0f14 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("automodel: 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 {
	ID        string
	Portid    string
	Name      string
	City      string
	Country   string
	Province  string
	Timezone  string
	Code      string
	Latitude  string
	Longitude string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	Portid:    "portid",
	Name:      "name",
	City:      "city",
	Country:   "country",
	Province:  "province",
	Timezone:  "timezone",
	Code:      "code",
	Latitude:  "latitude",
	Longitude: "longitude",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var PortRels = struct {
	PortsAliases         string
	UnlockidPortsUnlocks string
}{
	PortsAliases:         "PortsAliases",
	UnlockidPortsUnlocks: "UnlockidPortsUnlocks",
}

PortRels is where relationship names are stored.

View Source
var PortTableColumns = struct {
	ID        string
	Portid    string
	Name      string
	City      string
	Country   string
	Province  string
	Timezone  string
	Code      string
	Latitude  string
	Longitude string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "ports.id",
	Portid:    "ports.portid",
	Name:      "ports.name",
	City:      "ports.city",
	Country:   "ports.country",
	Province:  "ports.province",
	Timezone:  "ports.timezone",
	Code:      "ports.code",
	Latitude:  "ports.latitude",
	Longitude: "ports.longitude",
	CreatedAt: "ports.created_at",
	UpdatedAt: "ports.updated_at",
	DeletedAt: "ports.deleted_at",
}
View Source
var PortWhere = struct {
	ID        whereHelperint
	Portid    whereHelperstring
	Name      whereHelperstring
	City      whereHelperstring
	Country   whereHelperstring
	Province  whereHelpernull_String
	Timezone  whereHelperstring
	Code      whereHelperstring
	Latitude  whereHelperstring
	Longitude whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	Portid:    whereHelperstring{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	City:      whereHelperstring{/* contains filtered or unexported fields */},
	Country:   whereHelperstring{/* contains filtered or unexported fields */},
	Province:  whereHelpernull_String{/* contains filtered or unexported fields */},
	Timezone:  whereHelperstring{/* contains filtered or unexported fields */},
	Code:      whereHelperstring{/* contains filtered or unexported fields */},
	Latitude:  whereHelperstring{/* contains filtered or unexported fields */},
	Longitude: whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var PortsAliasColumns = struct {
	ID        string
	PortID    string
	Alias     string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	PortID:    "port_id",
	Alias:     "alias",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var PortsAliasRels = struct {
	Port string
}{
	Port: "Port",
}

PortsAliasRels is where relationship names are stored.

View Source
var PortsAliasTableColumns = struct {
	ID        string
	PortID    string
	Alias     string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "ports_aliases.id",
	PortID:    "ports_aliases.port_id",
	Alias:     "ports_aliases.alias",
	CreatedAt: "ports_aliases.created_at",
	UpdatedAt: "ports_aliases.updated_at",
	DeletedAt: "ports_aliases.deleted_at",
}
View Source
var PortsAliasWhere = struct {
	ID        whereHelperint
	PortID    whereHelperint
	Alias     whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	PortID:    whereHelperint{/* contains filtered or unexported fields */},
	Alias:     whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var PortsUnlockColumns = struct {
	ID        string
	PortID    string
	Unlockid  string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	PortID:    "port_id",
	Unlockid:  "unlockid",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var PortsUnlockRels = struct {
	UnlockidPort string
}{
	UnlockidPort: "UnlockidPort",
}

PortsUnlockRels is where relationship names are stored.

View Source
var PortsUnlockTableColumns = struct {
	ID        string
	PortID    string
	Unlockid  string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "ports_unlocks.id",
	PortID:    "ports_unlocks.port_id",
	Unlockid:  "ports_unlocks.unlockid",
	CreatedAt: "ports_unlocks.created_at",
	UpdatedAt: "ports_unlocks.updated_at",
	DeletedAt: "ports_unlocks.deleted_at",
}
View Source
var PortsUnlockWhere = struct {
	ID        whereHelperint
	PortID    whereHelperint
	Unlockid  whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	PortID:    whereHelperint{/* contains filtered or unexported fields */},
	Unlockid:  whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Ports        string
	PortsAliases string
	PortsUnlocks string
}{
	Ports:        "ports",
	PortsAliases: "ports_aliases",
	PortsUnlocks: "ports_unlocks",
}

Functions

func AddPortHook

func AddPortHook(hookPoint boil.HookPoint, portHook PortHook)

AddPortHook registers your hook function for all future operations.

func AddPortsAliasHook

func AddPortsAliasHook(hookPoint boil.HookPoint, portsAliasHook PortsAliasHook)

AddPortsAliasHook registers your hook function for all future operations.

func AddPortsUnlockHook

func AddPortsUnlockHook(hookPoint boil.HookPoint, portsUnlockHook PortsUnlockHook)

AddPortsUnlockHook 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, iD int) (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.

func PortsAliasExists

func PortsAliasExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

PortsAliasExists checks if the PortsAlias row exists.

func PortsAliases

func PortsAliases(mods ...qm.QueryMod) portsAliasQuery

PortsAliases retrieves all the records using an executor.

func PortsUnlockExists

func PortsUnlockExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

PortsUnlockExists checks if the PortsUnlock row exists.

func PortsUnlocks

func PortsUnlocks(mods ...qm.QueryMod) portsUnlockQuery

PortsUnlocks 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 {
	ID        int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	Portid    string      `boil:"portid" json:"portid" toml:"portid" yaml:"portid"`
	Name      string      `boil:"name" json:"name" toml:"name" yaml:"name"`
	City      string      `boil:"city" json:"city" toml:"city" yaml:"city"`
	Country   string      `boil:"country" json:"country" toml:"country" yaml:"country"`
	Province  null.String `boil:"province" json:"province,omitempty" toml:"province" yaml:"province,omitempty"`
	Timezone  string      `boil:"timezone" json:"timezone" toml:"timezone" yaml:"timezone"`
	Code      string      `boil:"code" json:"code" toml:"code" yaml:"code"`
	Latitude  string      `boil:"latitude" json:"latitude" toml:"latitude" yaml:"latitude"`
	Longitude string      `boil:"longitude" json:"longitude" toml:"longitude" yaml:"longitude"`
	CreatedAt time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	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"`

	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, iD int, 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) AddPortsAliases

func (o *Port) AddPortsAliases(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PortsAlias) error

AddPortsAliases adds the given related objects to the existing relationships of the port, optionally inserting them as new records. Appends related to o.R.PortsAliases. Sets related.R.Port appropriately.

func (*Port) AddUnlockidPortsUnlocks

func (o *Port) AddUnlockidPortsUnlocks(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PortsUnlock) error

AddUnlockidPortsUnlocks adds the given related objects to the existing relationships of the port, optionally inserting them as new records. Appends related to o.R.UnlockidPortsUnlocks. Sets related.R.UnlockidPort appropriately.

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) PortsAliases

func (o *Port) PortsAliases(mods ...qm.QueryMod) portsAliasQuery

PortsAliases retrieves all the ports_alias's PortsAliases with an executor.

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) UnlockidPortsUnlocks

func (o *Port) UnlockidPortsUnlocks(mods ...qm.QueryMod) portsUnlockQuery

UnlockidPortsUnlocks retrieves all the ports_unlock's PortsUnlocks with an executor via unlockid column.

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, 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 almost always be used instead of []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.

type PortsAlias

type PortsAlias struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	PortID    int       `boil:"port_id" json:"port_id" toml:"port_id" yaml:"port_id"`
	Alias     string    `boil:"alias" json:"alias" toml:"alias" yaml:"alias"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	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"`

	R *portsAliasR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L portsAliasL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

PortsAlias is an object representing the database table.

func FindPortsAlias

func FindPortsAlias(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*PortsAlias, error)

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

func (*PortsAlias) Delete

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

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

func (*PortsAlias) Insert

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

func (o *PortsAlias) Port(mods ...qm.QueryMod) portQuery

Port pointed to by the foreign key.

func (*PortsAlias) Reload

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

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

func (*PortsAlias) SetPort

func (o *PortsAlias) SetPort(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Port) error

SetPort of the portsAlias to the related item. Sets o.R.Port to related. Adds o to related.R.PortsAliases.

func (*PortsAlias) Update

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

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

func (o *PortsAlias) 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 PortsAliasHook

type PortsAliasHook func(context.Context, boil.ContextExecutor, *PortsAlias) error

PortsAliasHook is the signature for custom PortsAlias hook methods

type PortsAliasSlice

type PortsAliasSlice []*PortsAlias

PortsAliasSlice is an alias for a slice of pointers to PortsAlias. This should almost always be used instead of []PortsAlias.

func (PortsAliasSlice) DeleteAll

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

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

func (*PortsAliasSlice) ReloadAll

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

func (o PortsAliasSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type PortsUnlock

type PortsUnlock struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	PortID    int       `boil:"port_id" json:"port_id" toml:"port_id" yaml:"port_id"`
	Unlockid  string    `boil:"unlockid" json:"unlockid" toml:"unlockid" yaml:"unlockid"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	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"`

	R *portsUnlockR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L portsUnlockL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

PortsUnlock is an object representing the database table.

func FindPortsUnlock

func FindPortsUnlock(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*PortsUnlock, error)

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

func (*PortsUnlock) Delete

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

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

func (*PortsUnlock) Insert

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

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

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

func (*PortsUnlock) SetUnlockidPort

func (o *PortsUnlock) SetUnlockidPort(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Port) error

SetUnlockidPort of the portsUnlock to the related item. Sets o.R.UnlockidPort to related. Adds o to related.R.UnlockidPortsUnlocks.

func (*PortsUnlock) UnlockidPort

func (o *PortsUnlock) UnlockidPort(mods ...qm.QueryMod) portQuery

UnlockidPort pointed to by the foreign key.

func (*PortsUnlock) Update

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

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

func (o *PortsUnlock) 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 PortsUnlockHook

type PortsUnlockHook func(context.Context, boil.ContextExecutor, *PortsUnlock) error

PortsUnlockHook is the signature for custom PortsUnlock hook methods

type PortsUnlockSlice

type PortsUnlockSlice []*PortsUnlock

PortsUnlockSlice is an alias for a slice of pointers to PortsUnlock. This should almost always be used instead of []PortsUnlock.

func (PortsUnlockSlice) DeleteAll

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

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

func (*PortsUnlockSlice) ReloadAll

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

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