Documentation
¶
Index ¶
- Variables
- func AddProductHook(hookPoint boil.HookPoint, productHook ProductHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func ProductExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Products(mods ...qm.QueryMod) productQuery
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type GenderEnum
- type M
- type Product
- func (o *Product) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Product) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Product) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Product) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Product) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Product) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type ProductHook
- type ProductSlice
- type UpsertOptionFunc
- type UpsertOptions
- type User
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type UserHook
- type UserSlice
Constants ¶
This section is empty.
Variables ¶
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.
var ProductColumns = struct { ID string Name string Description string Price string Created string Modified string }{ ID: "id", Name: "name", Description: "description", Price: "price", Created: "created", Modified: "modified", }
var ProductRels = struct {
}{}
ProductRels is where relationship names are stored.
var ProductTableColumns = struct { ID string Name string Description string Price string Created string Modified string }{ ID: "products.id", Name: "products.name", Description: "products.description", Price: "products.price", Created: "products.created", Modified: "products.modified", }
var ProductWhere = struct { ID whereHelperint Name whereHelperstring Description whereHelperstring Price whereHelperint Created whereHelpertime_Time Modified whereHelpertime_Time }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, Description: whereHelperstring{/* contains filtered or unexported fields */}, Price: whereHelperint{/* contains filtered or unexported fields */}, Created: whereHelpertime_Time{/* contains filtered or unexported fields */}, Modified: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var TableNames = struct { Products string Users string }{ Products: "products", Users: "users", }
var UserColumns = struct { ID string Username string Password string Email string Name string Gender string Created string Modified string }{ ID: "id", Username: "username", Password: "password", Email: "email", Name: "name", Gender: "gender", Created: "created", Modified: "modified", }
var UserRels = struct {
}{}
UserRels is where relationship names are stored.
var UserTableColumns = struct { ID string Username string Password string Email string Name string Gender string Created string Modified string }{ ID: "users.id", Username: "users.username", Password: "users.password", Email: "users.email", Name: "users.name", Gender: "users.gender", Created: "users.created", Modified: "users.modified", }
var UserWhere = struct { ID whereHelperint Username whereHelperstring Password whereHelperstring Email whereHelperstring Name whereHelperstring Gender whereHelperGenderEnum Created whereHelpertime_Time Modified whereHelpertime_Time }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Username: whereHelperstring{/* contains filtered or unexported fields */}, Password: whereHelperstring{/* contains filtered or unexported fields */}, Email: whereHelperstring{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, Gender: whereHelperGenderEnum{/* contains filtered or unexported fields */}, Created: whereHelpertime_Time{/* contains filtered or unexported fields */}, Modified: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ViewNames = struct {
}{}
Functions ¶
func AddProductHook ¶
func AddProductHook(hookPoint boil.HookPoint, productHook ProductHook)
AddProductHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func ProductExists ¶
ProductExists checks if the Product row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type GenderEnum ¶
type GenderEnum string
const ( GenderEnumMale GenderEnum = "male" GenderEnumFemale GenderEnum = "female" )
Enum values for GenderEnum
func AllGenderEnum ¶
func AllGenderEnum() []GenderEnum
func (GenderEnum) IsValid ¶
func (e GenderEnum) IsValid() error
func (GenderEnum) Ordinal ¶
func (e GenderEnum) Ordinal() int
func (GenderEnum) String ¶
func (e GenderEnum) String() string
type M ¶
type M map[string]interface{}
M type is for providing columns and column values to UpdateAll.
type Product ¶
type Product struct {
ID int `boil:"id" json:"id" toml:"id" yaml:"id"`
Name string `boil:"name" json:"name" toml:"name" yaml:"name"`
Description string `boil:"description" json:"description" toml:"description" yaml:"description"`
Price int `boil:"price" json:"price" toml:"price" yaml:"price"`
Created time.Time `boil:"created" json:"created" toml:"created" yaml:"created"`
Modified time.Time `boil:"modified" json:"modified" toml:"modified" yaml:"modified"`
R *productR `boil:"-" json:"-" toml:"-" yaml:"-"`
L productL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
Product is an object representing the database table.
func FindProduct ¶
func FindProduct(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Product, error)
FindProduct retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Product) Delete ¶
Delete deletes a single Product record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Product) Insert ¶
func (o *Product) 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 (*Product) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Product) Update ¶
func (o *Product) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Product. 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 (*Product) Upsert ¶
func (o *Product) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) 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 ProductHook ¶
ProductHook is the signature for custom Product hook methods
type ProductSlice ¶
type ProductSlice []*Product
ProductSlice is an alias for a slice of pointers to Product. This should almost always be used instead of []Product.
func (ProductSlice) DeleteAll ¶
func (o ProductSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*ProductSlice) ReloadAll ¶
func (o *ProductSlice) 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 (ProductSlice) UpdateAll ¶
func (o ProductSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type UpsertOptionFunc ¶
type UpsertOptionFunc func(o *UpsertOptions)
func UpsertConflictTarget ¶
func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc
func UpsertUpdateSet ¶
func UpsertUpdateSet(updateSet string) UpsertOptionFunc
type UpsertOptions ¶
type UpsertOptions struct {
// contains filtered or unexported fields
}
type User ¶
type User struct {
ID int `boil:"id" json:"id" toml:"id" yaml:"id"`
Username string `boil:"username" json:"username" toml:"username" yaml:"username"`
Password string `boil:"password" json:"password" toml:"password" yaml:"password"`
Email string `boil:"email" json:"email" toml:"email" yaml:"email"`
Name string `boil:"name" json:"name" toml:"name" yaml:"name"`
Gender GenderEnum `boil:"gender" json:"gender" toml:"gender" yaml:"gender"`
Created time.Time `boil:"created" json:"created" toml:"created" yaml:"created"`
Modified time.Time `boil:"modified" json:"modified" toml:"modified" yaml:"modified"`
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 int, 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 ¶
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 ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*User) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
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, opts ...UpsertOptionFunc) 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 UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.