db

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildingColumns = struct {
	ID   string
	Name string
}{
	ID:   "id",
	Name: "name",
}
View Source
var BuildingRels = struct {
	Locations string
}{
	Locations: "Locations",
}

BuildingRels is where relationship names are stored.

View Source
var BuildingWhere = struct {
	ID   whereHelperstring
	Name whereHelperstring
}{
	ID:   whereHelperstring{/* contains filtered or unexported fields */},
	Name: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("db: 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 GroupColumns = struct {
	ID          string
	LocalID     string
	DisplayName string
}{
	ID:          "id",
	LocalID:     "local_id",
	DisplayName: "display_name",
}
View Source
var GroupRels = struct {
	Users     string
	Locations string
}{
	Users:     "Users",
	Locations: "Locations",
}

GroupRels is where relationship names are stored.

View Source
var GroupWhere = struct {
	ID          whereHelperstring
	LocalID     whereHelperstring
	DisplayName whereHelperstring
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	LocalID:     whereHelperstring{/* contains filtered or unexported fields */},
	DisplayName: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var LocationColumns = struct {
	ID         string
	BuildingID string
	Name       string
}{
	ID:         "id",
	BuildingID: "building_id",
	Name:       "name",
}
View Source
var LocationRels = struct {
	Building string
	Groups   string
	Users    string
	Printers string
}{
	Building: "Building",
	Groups:   "Groups",
	Users:    "Users",
	Printers: "Printers",
}

LocationRels is where relationship names are stored.

View Source
var LocationWhere = struct {
	ID         whereHelperstring
	BuildingID whereHelperstring
	Name       whereHelperstring
}{
	ID:         whereHelperstring{/* contains filtered or unexported fields */},
	BuildingID: whereHelperstring{/* contains filtered or unexported fields */},
	Name:       whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ManufacturerColumns = struct {
	ID   string
	Name string
}{
	ID:   "id",
	Name: "name",
}
View Source
var ManufacturerRels = struct {
	Models string
}{
	Models: "Models",
}

ManufacturerRels is where relationship names are stored.

View Source
var ManufacturerWhere = struct {
	ID   whereHelperstring
	Name whereHelperstring
}{
	ID:   whereHelperstring{/* contains filtered or unexported fields */},
	Name: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ModelColumns = struct {
	ID             string
	ManufacturerID string
	Name           string
	Driver         string
}{
	ID:             "id",
	ManufacturerID: "manufacturer_id",
	Name:           "name",
	Driver:         "driver",
}
View Source
var ModelRels = struct {
	Manufacturer string
	Printers     string
}{
	Manufacturer: "Manufacturer",
	Printers:     "Printers",
}

ModelRels is where relationship names are stored.

View Source
var ModelWhere = struct {
	ID             whereHelperstring
	ManufacturerID whereHelperstring
	Name           whereHelperstring
	Driver         whereHelpertypes_JSON
}{
	ID:             whereHelperstring{/* contains filtered or unexported fields */},
	ManufacturerID: whereHelperstring{/* contains filtered or unexported fields */},
	Name:           whereHelperstring{/* contains filtered or unexported fields */},
	Driver:         whereHelpertypes_JSON{/* contains filtered or unexported fields */},
}
View Source
var PrinterColumns = struct {
	ID          string
	ModelID     string
	LocationID  string
	Hostname    string
	DriverExtra string
}{
	ID:          "id",
	ModelID:     "model_id",
	LocationID:  "location_id",
	Hostname:    "hostname",
	DriverExtra: "driver_extra",
}
View Source
var PrinterRels = struct {
	Location string
	Model    string
}{
	Location: "Location",
	Model:    "Model",
}

PrinterRels is where relationship names are stored.

View Source
var PrinterWhere = struct {
	ID          whereHelperstring
	ModelID     whereHelperstring
	LocationID  whereHelperstring
	Hostname    whereHelperstring
	DriverExtra whereHelpernull_JSON
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	ModelID:     whereHelperstring{/* contains filtered or unexported fields */},
	LocationID:  whereHelperstring{/* contains filtered or unexported fields */},
	Hostname:    whereHelperstring{/* contains filtered or unexported fields */},
	DriverExtra: whereHelpernull_JSON{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Building                string
	Group                   string
	GroupUserAssignment     string
	Location                string
	LocationGroupAssignment string
	LocationUserAssignment  string
	Manufacturer            string
	Model                   string
	Printer                 string
	User                    string
}{
	Building:                "building",
	Group:                   "group",
	GroupUserAssignment:     "group_user_assignment",
	Location:                "location",
	LocationGroupAssignment: "location_group_assignment",
	LocationUserAssignment:  "location_user_assignment",
	Manufacturer:            "manufacturer",
	Model:                   "model",
	Printer:                 "printer",
	User:                    "user",
}
View Source
var UserColumns = struct {
	ID          string
	LocalID     string
	DisplayName string
	Username    string
}{
	ID:          "id",
	LocalID:     "local_id",
	DisplayName: "display_name",
	Username:    "username",
}
View Source
var UserRels = struct {
	Groups    string
	Locations string
}{
	Groups:    "Groups",
	Locations: "Locations",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	ID          whereHelperstring
	LocalID     whereHelperstring
	DisplayName whereHelperstring
	Username    whereHelperstring
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	LocalID:     whereHelperstring{/* contains filtered or unexported fields */},
	DisplayName: whereHelperstring{/* contains filtered or unexported fields */},
	Username:    whereHelperstring{/* contains filtered or unexported fields */},
}

Functions

func AddBuildingHook

func AddBuildingHook(hookPoint boil.HookPoint, buildingHook BuildingHook)

AddBuildingHook registers your hook function for all future operations.

func AddGroupHook

func AddGroupHook(hookPoint boil.HookPoint, groupHook GroupHook)

AddGroupHook registers your hook function for all future operations.

func AddLocationHook

func AddLocationHook(hookPoint boil.HookPoint, locationHook LocationHook)

AddLocationHook registers your hook function for all future operations.

func AddManufacturerHook

func AddManufacturerHook(hookPoint boil.HookPoint, manufacturerHook ManufacturerHook)

AddManufacturerHook registers your hook function for all future operations.

func AddModelHook

func AddModelHook(hookPoint boil.HookPoint, modelHook ModelHook)

AddModelHook registers your hook function for all future operations.

func AddPrinterHook

func AddPrinterHook(hookPoint boil.HookPoint, printerHook PrinterHook)

AddPrinterHook registers your hook function for all future operations.

func AddUserHook

func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)

AddUserHook registers your hook function for all future operations.

func BuildingExists

func BuildingExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

BuildingExists checks if the Building row exists.

func Buildings

func Buildings(mods ...qm.QueryMod) buildingQuery

Buildings retrieves all the records using an executor.

func GroupExists

func GroupExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

GroupExists checks if the Group row exists.

func Groups

func Groups(mods ...qm.QueryMod) groupQuery

Groups retrieves all the records using an executor.

func LocationExists

func LocationExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

LocationExists checks if the Location row exists.

func Locations

func Locations(mods ...qm.QueryMod) locationQuery

Locations retrieves all the records using an executor.

func ManufacturerExists

func ManufacturerExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

ManufacturerExists checks if the Manufacturer row exists.

func Manufacturers

func Manufacturers(mods ...qm.QueryMod) manufacturerQuery

Manufacturers retrieves all the records using an executor.

func ModelExists

func ModelExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

ModelExists checks if the Model row exists.

func Models

func Models(mods ...qm.QueryMod) modelQuery

Models 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

func PrinterExists

func PrinterExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

PrinterExists checks if the Printer row exists.

func Printers

func Printers(mods ...qm.QueryMod) printerQuery

Printers retrieves all the records using an executor.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

UserExists checks if the User row exists.

func Users

func Users(mods ...qm.QueryMod) userQuery

Users retrieves all the records using an executor.

Types

type Building

type Building struct {
	ID   string `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name string `boil:"name" json:"name" toml:"name" yaml:"name"`

	R *buildingR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L buildingL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Building is an object representing the database table.

func FindBuilding

func FindBuilding(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Building, error)

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

func (*Building) AddLocations

func (o *Building) AddLocations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Location) error

AddLocations adds the given related objects to the existing relationships of the building, optionally inserting them as new records. Appends related to o.R.Locations. Sets related.R.Building appropriately.

func (*Building) Delete

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

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

func (*Building) Insert

func (o *Building) 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 (*Building) Locations

func (o *Building) Locations(mods ...qm.QueryMod) locationQuery

Locations retrieves all the location's Locations with an executor.

func (*Building) Reload

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

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

func (*Building) Update

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

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

func (o *Building) 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 BuildingHook

type BuildingHook func(context.Context, boil.ContextExecutor, *Building) error

BuildingHook is the signature for custom Building hook methods

type BuildingSlice

type BuildingSlice []*Building

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

func (BuildingSlice) DeleteAll

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

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

func (*BuildingSlice) ReloadAll

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

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

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

type Group

type Group struct {
	ID          string `boil:"id" json:"id" toml:"id" yaml:"id"`
	LocalID     string `boil:"local_id" json:"local_id" toml:"local_id" yaml:"local_id"`
	DisplayName string `boil:"display_name" json:"display_name" toml:"display_name" yaml:"display_name"`

	R *groupR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L groupL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Group is an object representing the database table.

func FindGroup

func FindGroup(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Group, error)

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

func (*Group) AddLocations

func (o *Group) AddLocations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Location) error

AddLocations adds the given related objects to the existing relationships of the group, optionally inserting them as new records. Appends related to o.R.Locations. Sets related.R.Groups appropriately.

func (*Group) AddUsers

func (o *Group) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

AddUsers adds the given related objects to the existing relationships of the group, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Groups appropriately.

func (*Group) Delete

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

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

func (*Group) Insert

func (o *Group) 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 (*Group) Locations

func (o *Group) Locations(mods ...qm.QueryMod) locationQuery

Locations retrieves all the location's Locations with an executor.

func (*Group) Reload

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

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

func (*Group) RemoveLocations

func (o *Group) RemoveLocations(ctx context.Context, exec boil.ContextExecutor, related ...*Location) error

RemoveLocations relationships from objects passed in. Removes related items from R.Locations (uses pointer comparison, removal does not keep order) Sets related.R.Groups.

func (*Group) RemoveUsers

func (o *Group) RemoveUsers(ctx context.Context, exec boil.ContextExecutor, related ...*User) error

RemoveUsers relationships from objects passed in. Removes related items from R.Users (uses pointer comparison, removal does not keep order) Sets related.R.Groups.

func (*Group) SetLocations

func (o *Group) SetLocations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Location) error

SetLocations removes all previously related items of the group replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Groups's Locations accordingly. Replaces o.R.Locations with related. Sets related.R.Groups's Locations accordingly.

func (*Group) SetUsers

func (o *Group) SetUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

SetUsers removes all previously related items of the group replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Groups's Users accordingly. Replaces o.R.Users with related. Sets related.R.Groups's Users accordingly.

func (*Group) Update

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

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

func (o *Group) 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.

func (*Group) Users

func (o *Group) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type GroupHook

type GroupHook func(context.Context, boil.ContextExecutor, *Group) error

GroupHook is the signature for custom Group hook methods

type GroupSlice

type GroupSlice []*Group

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

func (GroupSlice) DeleteAll

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

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

func (*GroupSlice) ReloadAll

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

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

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

type Location

type Location struct {
	ID         string `boil:"id" json:"id" toml:"id" yaml:"id"`
	BuildingID string `boil:"building_id" json:"building_id" toml:"building_id" yaml:"building_id"`
	Name       string `boil:"name" json:"name" toml:"name" yaml:"name"`

	R *locationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L locationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Location is an object representing the database table.

func FindLocation

func FindLocation(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Location, error)

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

func (*Location) AddGroups

func (o *Location) AddGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

AddGroups adds the given related objects to the existing relationships of the location, optionally inserting them as new records. Appends related to o.R.Groups. Sets related.R.Locations appropriately.

func (*Location) AddPrinters

func (o *Location) AddPrinters(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Printer) error

AddPrinters adds the given related objects to the existing relationships of the location, optionally inserting them as new records. Appends related to o.R.Printers. Sets related.R.Location appropriately.

func (*Location) AddUsers

func (o *Location) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

AddUsers adds the given related objects to the existing relationships of the location, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Locations appropriately.

func (*Location) Building

func (o *Location) Building(mods ...qm.QueryMod) buildingQuery

Building pointed to by the foreign key.

func (*Location) Delete

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

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

func (*Location) Groups

func (o *Location) Groups(mods ...qm.QueryMod) groupQuery

Groups retrieves all the group's Groups with an executor.

func (*Location) Insert

func (o *Location) 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 (*Location) Printers

func (o *Location) Printers(mods ...qm.QueryMod) printerQuery

Printers retrieves all the printer's Printers with an executor.

func (*Location) Reload

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

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

func (*Location) RemoveGroups

func (o *Location) RemoveGroups(ctx context.Context, exec boil.ContextExecutor, related ...*Group) error

RemoveGroups relationships from objects passed in. Removes related items from R.Groups (uses pointer comparison, removal does not keep order) Sets related.R.Locations.

func (*Location) RemoveUsers

func (o *Location) RemoveUsers(ctx context.Context, exec boil.ContextExecutor, related ...*User) error

RemoveUsers relationships from objects passed in. Removes related items from R.Users (uses pointer comparison, removal does not keep order) Sets related.R.Locations.

func (*Location) SetBuilding

func (o *Location) SetBuilding(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Building) error

SetBuilding of the location to the related item. Sets o.R.Building to related. Adds o to related.R.Locations.

func (*Location) SetGroups

func (o *Location) SetGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

SetGroups removes all previously related items of the location replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Locations's Groups accordingly. Replaces o.R.Groups with related. Sets related.R.Locations's Groups accordingly.

func (*Location) SetUsers

func (o *Location) SetUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

SetUsers removes all previously related items of the location replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Locations's Users accordingly. Replaces o.R.Users with related. Sets related.R.Locations's Users accordingly.

func (*Location) Update

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

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

func (o *Location) 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.

func (*Location) Users

func (o *Location) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type LocationHook

type LocationHook func(context.Context, boil.ContextExecutor, *Location) error

LocationHook is the signature for custom Location hook methods

type LocationSlice

type LocationSlice []*Location

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

func (LocationSlice) DeleteAll

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

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

func (*LocationSlice) ReloadAll

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

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

type Manufacturer

type Manufacturer struct {
	ID   string `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name string `boil:"name" json:"name" toml:"name" yaml:"name"`

	R *manufacturerR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L manufacturerL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Manufacturer is an object representing the database table.

func FindManufacturer

func FindManufacturer(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Manufacturer, error)

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

func (*Manufacturer) AddModels

func (o *Manufacturer) AddModels(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Model) error

AddModels adds the given related objects to the existing relationships of the manufacturer, optionally inserting them as new records. Appends related to o.R.Models. Sets related.R.Manufacturer appropriately.

func (*Manufacturer) Delete

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

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

func (*Manufacturer) Insert

func (o *Manufacturer) 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 (*Manufacturer) Models

func (o *Manufacturer) Models(mods ...qm.QueryMod) modelQuery

Models retrieves all the model's Models with an executor.

func (*Manufacturer) Reload

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

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

func (*Manufacturer) Update

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

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

func (o *Manufacturer) 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 ManufacturerHook

type ManufacturerHook func(context.Context, boil.ContextExecutor, *Manufacturer) error

ManufacturerHook is the signature for custom Manufacturer hook methods

type ManufacturerSlice

type ManufacturerSlice []*Manufacturer

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

func (ManufacturerSlice) DeleteAll

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

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

func (*ManufacturerSlice) ReloadAll

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

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

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

type Model

type Model struct {
	ID             string     `boil:"id" json:"id" toml:"id" yaml:"id"`
	ManufacturerID string     `boil:"manufacturer_id" json:"manufacturer_id" toml:"manufacturer_id" yaml:"manufacturer_id"`
	Name           string     `boil:"name" json:"name" toml:"name" yaml:"name"`
	Driver         types.JSON `boil:"driver" json:"driver" toml:"driver" yaml:"driver"`

	R *modelR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L modelL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Model is an object representing the database table.

func FindModel

func FindModel(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Model, error)

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

func (*Model) AddPrinters

func (o *Model) AddPrinters(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Printer) error

AddPrinters adds the given related objects to the existing relationships of the model, optionally inserting them as new records. Appends related to o.R.Printers. Sets related.R.Model appropriately.

func (*Model) Delete

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

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

func (*Model) Insert

func (o *Model) 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 (*Model) Manufacturer

func (o *Model) Manufacturer(mods ...qm.QueryMod) manufacturerQuery

Manufacturer pointed to by the foreign key.

func (*Model) Printers

func (o *Model) Printers(mods ...qm.QueryMod) printerQuery

Printers retrieves all the printer's Printers with an executor.

func (*Model) Reload

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

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

func (*Model) SetManufacturer

func (o *Model) SetManufacturer(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Manufacturer) error

SetManufacturer of the model to the related item. Sets o.R.Manufacturer to related. Adds o to related.R.Models.

func (*Model) Update

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

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

func (o *Model) 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 ModelHook

type ModelHook func(context.Context, boil.ContextExecutor, *Model) error

ModelHook is the signature for custom Model hook methods

type ModelSlice

type ModelSlice []*Model

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

func (ModelSlice) DeleteAll

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

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

func (*ModelSlice) ReloadAll

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

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

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

type Printer

type Printer struct {
	ID          string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	ModelID     string    `boil:"model_id" json:"model_id" toml:"model_id" yaml:"model_id"`
	LocationID  string    `boil:"location_id" json:"location_id" toml:"location_id" yaml:"location_id"`
	Hostname    string    `boil:"hostname" json:"hostname" toml:"hostname" yaml:"hostname"`
	DriverExtra null.JSON `boil:"driver_extra" json:"driver_extra,omitempty" toml:"driver_extra" yaml:"driver_extra,omitempty"`

	R *printerR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L printerL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Printer is an object representing the database table.

func FindPrinter

func FindPrinter(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Printer, error)

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

func (*Printer) Delete

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

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

func (*Printer) Insert

func (o *Printer) 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 (*Printer) Location

func (o *Printer) Location(mods ...qm.QueryMod) locationQuery

Location pointed to by the foreign key.

func (*Printer) Model

func (o *Printer) Model(mods ...qm.QueryMod) modelQuery

Model pointed to by the foreign key.

func (*Printer) Reload

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

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

func (*Printer) SetLocation

func (o *Printer) SetLocation(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Location) error

SetLocation of the printer to the related item. Sets o.R.Location to related. Adds o to related.R.Printers.

func (*Printer) SetModel

func (o *Printer) SetModel(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Model) error

SetModel of the printer to the related item. Sets o.R.Model to related. Adds o to related.R.Printers.

func (*Printer) Update

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

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

func (o *Printer) 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 PrinterHook

type PrinterHook func(context.Context, boil.ContextExecutor, *Printer) error

PrinterHook is the signature for custom Printer hook methods

type PrinterSlice

type PrinterSlice []*Printer

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

func (PrinterSlice) DeleteAll

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

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

func (*PrinterSlice) ReloadAll

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

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

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

type User

type User struct {
	ID          string `boil:"id" json:"id" toml:"id" yaml:"id"`
	LocalID     string `boil:"local_id" json:"local_id" toml:"local_id" yaml:"local_id"`
	DisplayName string `boil:"display_name" json:"display_name" toml:"display_name" yaml:"display_name"`
	Username    string `boil:"username" json:"username" toml:"username" yaml:"username"`

	R *userR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

User is an object representing the database table.

func FindUser

func FindUser(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*User, error)

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

func (*User) AddGroups

func (o *User) AddGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

AddGroups adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Groups. Sets related.R.Users appropriately.

func (*User) AddLocations

func (o *User) AddLocations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Location) error

AddLocations adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Locations. Sets related.R.Users appropriately.

func (*User) Delete

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

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

func (*User) Groups

func (o *User) Groups(mods ...qm.QueryMod) groupQuery

Groups retrieves all the group's Groups with an executor.

func (*User) Insert

func (o *User) 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 (*User) Locations

func (o *User) Locations(mods ...qm.QueryMod) locationQuery

Locations retrieves all the location's Locations with an executor.

func (*User) Reload

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

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

func (*User) RemoveGroups

func (o *User) RemoveGroups(ctx context.Context, exec boil.ContextExecutor, related ...*Group) error

RemoveGroups relationships from objects passed in. Removes related items from R.Groups (uses pointer comparison, removal does not keep order) Sets related.R.Users.

func (*User) RemoveLocations

func (o *User) RemoveLocations(ctx context.Context, exec boil.ContextExecutor, related ...*Location) error

RemoveLocations relationships from objects passed in. Removes related items from R.Locations (uses pointer comparison, removal does not keep order) Sets related.R.Users.

func (*User) SetGroups

func (o *User) SetGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

SetGroups removes all previously related items of the user replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Users's Groups accordingly. Replaces o.R.Groups with related. Sets related.R.Users's Groups accordingly.

func (*User) SetLocations

func (o *User) SetLocations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Location) error

SetLocations removes all previously related items of the user replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Users's Locations accordingly. Replaces o.R.Locations with related. Sets related.R.Users's Locations accordingly.

func (*User) Update

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

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

func (o *User) 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 UserHook

type UserHook func(context.Context, boil.ContextExecutor, *User) error

UserHook is the signature for custom User hook methods

type UserSlice

type UserSlice []*User

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

func (UserSlice) DeleteAll

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

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

func (*UserSlice) ReloadAll

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL