models

package
v0.0.0-...-caa7b66 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: GPL-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 RegistryColumns = struct {
	ID       string
	UserName string
	Request  string
	Response string
}{
	ID:       "id",
	UserName: "user_name",
	Request:  "request",
	Response: "response",
}
View Source
var RegistryRels = struct {
	UserNameUser string
}{
	UserNameUser: "UserNameUser",
}

RegistryRels is where relationship names are stored.

View Source
var RegistryWhere = struct {
	ID       whereHelpernull_String
	UserName whereHelpernull_String
	Request  whereHelpernull_Bytes
	Response whereHelpernull_Bytes
}{
	ID:       whereHelpernull_String{/* contains filtered or unexported fields */},
	UserName: whereHelpernull_String{/* contains filtered or unexported fields */},
	Request:  whereHelpernull_Bytes{/* contains filtered or unexported fields */},
	Response: whereHelpernull_Bytes{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Registries string
	Users      string
}{
	Registries: "registries",
	Users:      "users",
}
View Source
var UserColumns = struct {
	UserName string
	Name     string
	Password string
}{
	UserName: "user_name",
	Name:     "name",
	Password: "password",
}
View Source
var UserRels = struct {
	UserNameRegistry string
}{
	UserNameRegistry: "UserNameRegistry",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	UserName whereHelpernull_String
	Name     whereHelpernull_String
	Password whereHelpernull_String
}{
	UserName: whereHelpernull_String{/* contains filtered or unexported fields */},
	Name:     whereHelpernull_String{/* contains filtered or unexported fields */},
	Password: whereHelpernull_String{/* contains filtered or unexported fields */},
}

Functions

func AddRegistryHook

func AddRegistryHook(hookPoint boil.HookPoint, registryHook RegistryHook)

AddRegistryHook 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 NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func Registries

func Registries(mods ...qm.QueryMod) registryQuery

Registries retrieves all the records using an executor.

func RegistryExists

func RegistryExists(ctx context.Context, exec boil.ContextExecutor, iD null.String) (bool, error)

RegistryExists checks if the Registry row exists.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, userName null.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 M

type M map[string]interface{}

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

type Registry

type Registry struct {
	ID       null.String `boil:"id" json:"id,omitempty" toml:"id" yaml:"id,omitempty"`
	UserName null.String `boil:"user_name" json:"user_name,omitempty" toml:"user_name" yaml:"user_name,omitempty"`
	Request  null.Bytes  `boil:"request" json:"request,omitempty" toml:"request" yaml:"request,omitempty"`
	Response null.Bytes  `boil:"response" json:"response,omitempty" toml:"response" yaml:"response,omitempty"`

	R *registryR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L registryL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Registry is an object representing the database table.

func FindRegistry

func FindRegistry(ctx context.Context, exec boil.ContextExecutor, iD null.String, selectCols ...string) (*Registry, error)

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

func (*Registry) Delete

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

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

func (*Registry) Insert

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

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

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

func (*Registry) RemoveUserNameUser

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

RemoveUserNameUser relationship. Sets o.R.UserNameUser to nil. Removes o from all passed in related items' relationships struct (Optional).

func (*Registry) SetUserNameUser

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

SetUserNameUser of the registry to the related item. Sets o.R.UserNameUser to related. Adds o to related.R.UserNameRegistry.

func (*Registry) Update

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

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

func (o *Registry) UserNameUser(mods ...qm.QueryMod) userQuery

UserNameUser pointed to by the foreign key.

type RegistryHook

type RegistryHook func(context.Context, boil.ContextExecutor, *Registry) error

RegistryHook is the signature for custom Registry hook methods

type RegistrySlice

type RegistrySlice []*Registry

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

func (RegistrySlice) DeleteAll

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

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

func (*RegistrySlice) ReloadAll

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

func (o RegistrySlice) 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 {
	UserName null.String `boil:"user_name" json:"user_name,omitempty" toml:"user_name" yaml:"user_name,omitempty"`
	Name     null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	Password null.String `boil:"password" json:"password,omitempty" toml:"password" yaml:"password,omitempty"`

	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, userName null.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) 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) 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) 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) RemoveUserNameRegistry

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

RemoveUserNameRegistry relationship. Sets o.R.UserNameRegistry to nil. Removes o from all passed in related items' relationships struct (Optional).

func (*User) SetUserNameRegistry

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

SetUserNameRegistry of the user to the related item. Sets o.R.UserNameRegistry to related. Adds o to related.R.UserNameUser.

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

func (o *User) UserNameRegistry(mods ...qm.QueryMod) registryQuery

UserNameRegistry pointed to by the foreign key.

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.

Jump to

Keyboard shortcuts

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