Documentation ¶
Index ¶
- Variables
- func AddEmailHook(hookPoint boil.HookPoint, emailHook EmailHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func EmailExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Emails(mods ...qm.QueryMod) emailQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type Email
- func (o *Email) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Email) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Email) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Email) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *Email) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Email) Upsert(ctx context.Context, exec boil.ContextExecutor, ...) error
- func (o *Email) User(mods ...qm.QueryMod) userQuery
- type EmailHook
- type EmailSlice
- type M
- type User
- func (o *User) AddEmails(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Email) error
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Emails(mods ...qm.QueryMod) emailQuery
- 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, ...) error
- type UserHook
- type UserSlice
Constants ¶
This section is empty.
Variables ¶
var EmailColumns = struct { ID string Address string Primary string UserID string }{ ID: "id", Address: "address", Primary: "primary", UserID: "user_id", }
var EmailRels = struct { User string }{ User: "User", }
EmailRels is where relationship names are stored.
var EmailTableColumns = struct { ID string Address string Primary string UserID string }{ ID: "emails.id", Address: "emails.address", Primary: "emails.primary", UserID: "emails.user_id", }
var EmailWhere = struct { ID whereHelperint64 Address whereHelperstring Primary whereHelperbool UserID whereHelperint64 }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, Address: whereHelperstring{/* contains filtered or unexported fields */}, Primary: whereHelperbool{/* contains filtered or unexported fields */}, UserID: whereHelperint64{/* contains filtered or unexported fields */}, }
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 TableNames = struct { Emails string Users string }{ Emails: "emails", Users: "users", }
var UserColumns = struct { ID string FirstName string LastName string PasswordHash string LastIP string CreatedAt string UpdatedAt string }{ ID: "id", FirstName: "first_name", LastName: "last_name", PasswordHash: "password_hash", LastIP: "last_ip", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var UserRels = struct { Emails string }{ Emails: "Emails", }
UserRels is where relationship names are stored.
var UserTableColumns = struct { ID string FirstName string LastName string PasswordHash string LastIP string CreatedAt string UpdatedAt string }{ ID: "users.id", FirstName: "users.first_name", LastName: "users.last_name", PasswordHash: "users.password_hash", LastIP: "users.last_ip", CreatedAt: "users.created_at", UpdatedAt: "users.updated_at", }
var UserWhere = struct { ID whereHelperint64 FirstName whereHelperstring LastName whereHelperstring PasswordHash whereHelpernull_String LastIP whereHelpernull_String CreatedAt whereHelpernull_Time UpdatedAt whereHelpernull_Time }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, FirstName: whereHelperstring{/* contains filtered or unexported fields */}, LastName: whereHelperstring{/* contains filtered or unexported fields */}, PasswordHash: whereHelpernull_String{/* contains filtered or unexported fields */}, LastIP: whereHelpernull_String{/* contains filtered or unexported fields */}, CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, }
Functions ¶
func AddEmailHook ¶
AddEmailHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func EmailExists ¶
EmailExists checks if the Email row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type Email ¶
type Email struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` Address string `boil:"address" json:"address" toml:"address" yaml:"address"` Primary bool `boil:"primary" json:"primary" toml:"primary" yaml:"primary"` UserID int64 `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` R *emailR `boil:"-" json:"-" toml:"-" yaml:"-"` L emailL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Email is an object representing the database table.
func FindEmail ¶
func FindEmail(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Email, error)
FindEmail retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Email) Delete ¶
Delete deletes a single Email record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Email) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Email) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Email) SetUser ¶
func (o *Email) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the email to the related item. Sets o.R.User to related. Adds o to related.R.Emails.
func (*Email) Update ¶
func (o *Email) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Email. 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 (*Email) Upsert ¶
func (o *Email) 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 EmailSlice ¶
type EmailSlice []*Email
EmailSlice is an alias for a slice of pointers to Email. This should almost always be used instead of []Email.
func (EmailSlice) DeleteAll ¶
func (o EmailSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*EmailSlice) ReloadAll ¶
func (o *EmailSlice) 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 (EmailSlice) UpdateAll ¶
func (o EmailSlice) 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 User ¶
type User struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` FirstName string `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"` LastName string `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"` PasswordHash null.String `boil:"password_hash" json:"password_hash,omitempty" toml:"password_hash" yaml:"password_hash,omitempty"` LastIP null.String `boil:"last_ip" json:"last_ip,omitempty" toml:"last_ip" yaml:"last_ip,omitempty"` CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"` UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,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, iD int64, 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) AddEmails ¶
func (o *User) AddEmails(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Email) error
AddEmails adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Emails. Sets related.R.User appropriately.
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, 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 UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.