dbmodels

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("dbmodels: 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 InstanceColumns = struct {
	ID        string
	Name      string
	URL       string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	Name:      "name",
	URL:       "url",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var InstanceRels = struct {
	Profiles string
}{
	Profiles: "Profiles",
}

InstanceRels is where relationship names are stored.

View Source
var InstanceTableColumns = struct {
	ID        string
	Name      string
	URL       string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "instances.id",
	Name:      "instances.name",
	URL:       "instances.url",
	CreatedAt: "instances.created_at",
	UpdatedAt: "instances.updated_at",
	DeletedAt: "instances.deleted_at",
}
View Source
var InstanceWhere = struct {
	ID        whereHelperstring
	Name      whereHelperstring
	URL       whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperstring{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	URL:       whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var ProfileColumns = struct {
	ID         string
	UserID     string
	InstanceID string
	Role       string
	CreatedAt  string
	UpdatedAt  string
	DeletedAt  string
}{
	ID:         "id",
	UserID:     "user_id",
	InstanceID: "instance_id",
	Role:       "role",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
	DeletedAt:  "deleted_at",
}
View Source
var ProfileRels = struct {
	Instance string
	User     string
	Tokens   string
}{
	Instance: "Instance",
	User:     "User",
	Tokens:   "Tokens",
}

ProfileRels is where relationship names are stored.

View Source
var ProfileTableColumns = struct {
	ID         string
	UserID     string
	InstanceID string
	Role       string
	CreatedAt  string
	UpdatedAt  string
	DeletedAt  string
}{
	ID:         "profiles.id",
	UserID:     "profiles.user_id",
	InstanceID: "profiles.instance_id",
	Role:       "profiles.role",
	CreatedAt:  "profiles.created_at",
	UpdatedAt:  "profiles.updated_at",
	DeletedAt:  "profiles.deleted_at",
}
View Source
var ProfileWhere = struct {
	ID         whereHelperstring
	UserID     whereHelperstring
	InstanceID whereHelperstring
	Role       whereHelpernull_String
	CreatedAt  whereHelpertime_Time
	UpdatedAt  whereHelpertime_Time
	DeletedAt  whereHelpernull_Time
}{
	ID:         whereHelperstring{/* contains filtered or unexported fields */},
	UserID:     whereHelperstring{/* contains filtered or unexported fields */},
	InstanceID: whereHelperstring{/* contains filtered or unexported fields */},
	Role:       whereHelpernull_String{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	DeletedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Instances string
	Profiles  string
	Tokens    string
	Users     string
}{
	Instances: "instances",
	Profiles:  "profiles",
	Tokens:    "tokens",
	Users:     "users",
}
View Source
var TokenColumns = struct {
	ID        string
	UserID    string
	ProfileID string
	Token     string
	CreatedAt string
	ExpiresAt string
}{
	ID:        "id",
	UserID:    "user_id",
	ProfileID: "profile_id",
	Token:     "token",
	CreatedAt: "created_at",
	ExpiresAt: "expires_at",
}
View Source
var TokenRels = struct {
	Profile string
	User    string
}{
	Profile: "Profile",
	User:    "User",
}

TokenRels is where relationship names are stored.

View Source
var TokenTableColumns = struct {
	ID        string
	UserID    string
	ProfileID string
	Token     string
	CreatedAt string
	ExpiresAt string
}{
	ID:        "tokens.id",
	UserID:    "tokens.user_id",
	ProfileID: "tokens.profile_id",
	Token:     "tokens.token",
	CreatedAt: "tokens.created_at",
	ExpiresAt: "tokens.expires_at",
}
View Source
var TokenWhere = struct {
	ID        whereHelperint64
	UserID    whereHelperstring
	ProfileID whereHelperstring
	Token     whereHelperstring
	CreatedAt whereHelpertime_Time
	ExpiresAt whereHelpertime_Time
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	UserID:    whereHelperstring{/* contains filtered or unexported fields */},
	ProfileID: whereHelperstring{/* contains filtered or unexported fields */},
	Token:     whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	ExpiresAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var UserColumns = struct {
	ID          string
	Name        string
	Email       string
	Password    string
	ActivatedAt string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   string
}{
	ID:          "id",
	Name:        "name",
	Email:       "email",
	Password:    "password",
	ActivatedAt: "activated_at",
	CreatedAt:   "created_at",
	UpdatedAt:   "updated_at",
	DeletedAt:   "deleted_at",
}
View Source
var UserRels = struct {
	Profiles string
	Tokens   string
}{
	Profiles: "Profiles",
	Tokens:   "Tokens",
}

UserRels is where relationship names are stored.

View Source
var UserTableColumns = struct {
	ID          string
	Name        string
	Email       string
	Password    string
	ActivatedAt string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   string
}{
	ID:          "users.id",
	Name:        "users.name",
	Email:       "users.email",
	Password:    "users.password",
	ActivatedAt: "users.activated_at",
	CreatedAt:   "users.created_at",
	UpdatedAt:   "users.updated_at",
	DeletedAt:   "users.deleted_at",
}
View Source
var UserWhere = struct {
	ID          whereHelperstring
	Name        whereHelpernull_String
	Email       whereHelperstring
	Password    whereHelper__byte
	ActivatedAt whereHelpernull_Time
	CreatedAt   whereHelpertime_Time
	UpdatedAt   whereHelpertime_Time
	DeletedAt   whereHelpernull_Time
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	Name:        whereHelpernull_String{/* contains filtered or unexported fields */},
	Email:       whereHelperstring{/* contains filtered or unexported fields */},
	Password:    whereHelper__byte{/* contains filtered or unexported fields */},
	ActivatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	DeletedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
}

Functions

func AddInstanceHook

func AddInstanceHook(hookPoint boil.HookPoint, instanceHook InstanceHook)

AddInstanceHook registers your hook function for all future operations.

func AddProfileHook

func AddProfileHook(hookPoint boil.HookPoint, profileHook ProfileHook)

AddProfileHook registers your hook function for all future operations.

func AddTokenHook

func AddTokenHook(hookPoint boil.HookPoint, tokenHook TokenHook)

AddTokenHook 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 InstanceExists

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

InstanceExists checks if the Instance row exists.

func Instances

func Instances(mods ...qm.QueryMod) instanceQuery

Instances 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 ProfileExists

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

ProfileExists checks if the Profile row exists.

func Profiles

func Profiles(mods ...qm.QueryMod) profileQuery

Profiles retrieves all the records using an executor.

func TokenExists

func TokenExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

TokenExists checks if the Token row exists.

func Tokens

func Tokens(mods ...qm.QueryMod) tokenQuery

Tokens 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 Instance

type Instance struct {
	ID        string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	URL       string    `boil:"url" json:"url" toml:"url" yaml:"url"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *instanceR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L instanceL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Instance is an object representing the database table.

func FindInstance

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

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

func (*Instance) AddProfiles

func (o *Instance) AddProfiles(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Profile) error

AddProfiles adds the given related objects to the existing relationships of the instance, optionally inserting them as new records. Appends related to o.R.Profiles. Sets related.R.Instance appropriately.

func (*Instance) Delete

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

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

func (*Instance) Insert

func (o *Instance) 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 (*Instance) Profiles

func (o *Instance) Profiles(mods ...qm.QueryMod) profileQuery

Profiles retrieves all the profile's Profiles with an executor.

func (*Instance) Reload

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

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

func (*Instance) Update

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

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

func (o *Instance) 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 InstanceHook

type InstanceHook func(context.Context, boil.ContextExecutor, *Instance) error

InstanceHook is the signature for custom Instance hook methods

type InstanceSlice

type InstanceSlice []*Instance

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

func (InstanceSlice) DeleteAll

func (o InstanceSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor, hardDelete bool) (int64, error)

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

func (*InstanceSlice) ReloadAll

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

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

type Profile struct {
	ID         string      `boil:"id" json:"id" toml:"id" yaml:"id"`
	UserID     string      `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	InstanceID string      `boil:"instance_id" json:"instance_id" toml:"instance_id" yaml:"instance_id"`
	Role       null.String `boil:"role" json:"role,omitempty" toml:"role" yaml:"role,omitempty"`
	CreatedAt  time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt  time.Time   `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	DeletedAt  null.Time   `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *profileR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L profileL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Profile is an object representing the database table.

func FindProfile

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

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

func (*Profile) AddTokens

func (o *Profile) AddTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Token) error

AddTokens adds the given related objects to the existing relationships of the profile, optionally inserting them as new records. Appends related to o.R.Tokens. Sets related.R.Profile appropriately.

func (*Profile) Delete

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

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

func (*Profile) Insert

func (o *Profile) 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 (*Profile) Instance

func (o *Profile) Instance(mods ...qm.QueryMod) instanceQuery

Instance pointed to by the foreign key.

func (*Profile) Reload

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

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

func (*Profile) SetInstance

func (o *Profile) SetInstance(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Instance) error

SetInstance of the profile to the related item. Sets o.R.Instance to related. Adds o to related.R.Profiles.

func (*Profile) SetUser

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

SetUser of the profile to the related item. Sets o.R.User to related. Adds o to related.R.Profiles.

func (*Profile) Tokens

func (o *Profile) Tokens(mods ...qm.QueryMod) tokenQuery

Tokens retrieves all the token's Tokens with an executor.

func (*Profile) Update

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

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

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

func (o *Profile) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type ProfileHook

type ProfileHook func(context.Context, boil.ContextExecutor, *Profile) error

ProfileHook is the signature for custom Profile hook methods

type ProfileSlice

type ProfileSlice []*Profile

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

func (ProfileSlice) DeleteAll

func (o ProfileSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor, hardDelete bool) (int64, error)

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

func (*ProfileSlice) ReloadAll

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

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

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

type Token

type Token struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	UserID    string    `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	ProfileID string    `boil:"profile_id" json:"profile_id" toml:"profile_id" yaml:"profile_id"`
	Token     string    `boil:"token" json:"token" toml:"token" yaml:"token"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	ExpiresAt time.Time `boil:"expires_at" json:"expires_at" toml:"expires_at" yaml:"expires_at"`

	R *tokenR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tokenL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Token is an object representing the database table.

func FindToken

func FindToken(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Token, error)

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

func (*Token) Delete

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

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

func (*Token) Insert

func (o *Token) 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 (*Token) Profile

func (o *Token) Profile(mods ...qm.QueryMod) profileQuery

Profile pointed to by the foreign key.

func (*Token) Reload

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

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

func (*Token) SetProfile

func (o *Token) SetProfile(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Profile) error

SetProfile of the token to the related item. Sets o.R.Profile to related. Adds o to related.R.Tokens.

func (*Token) SetUser

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

SetUser of the token to the related item. Sets o.R.User to related. Adds o to related.R.Tokens.

func (*Token) Update

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

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

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

func (o *Token) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type TokenHook

type TokenHook func(context.Context, boil.ContextExecutor, *Token) error

TokenHook is the signature for custom Token hook methods

type TokenSlice

type TokenSlice []*Token

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

func (TokenSlice) DeleteAll

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

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

func (*TokenSlice) ReloadAll

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

func (o TokenSlice) 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"`
	Name        null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	Email       string      `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password    []byte      `boil:"password" json:"password" toml:"password" yaml:"password"`
	ActivatedAt null.Time   `boil:"activated_at" json:"activated_at,omitempty" toml:"activated_at" yaml:"activated_at,omitempty"`
	CreatedAt   time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time   `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	DeletedAt   null.Time   `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_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 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) AddProfiles

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

AddProfiles adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Profiles. Sets related.R.User appropriately.

func (*User) AddTokens

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

AddTokens adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Tokens. Sets related.R.User appropriately.

func (*User) Delete

func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor, hardDelete bool) (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) Profiles

func (o *User) Profiles(mods ...qm.QueryMod) profileQuery

Profiles retrieves all the profile's Profiles 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) Tokens

func (o *User) Tokens(mods ...qm.QueryMod) tokenQuery

Tokens retrieves all the token's Tokens 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) 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 almost always be used instead of []User.

func (UserSlice) DeleteAll

func (o UserSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor, hardDelete bool) (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