models

package
v0.0.0-...-4135f6e Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChannelColumns = struct {
	ID        string
	CreatorID string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	CreatorID: "creator_id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var ChannelMemberColumns = struct {
	ChannelID string
	UserID    string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ChannelID: "channel_id",
	UserID:    "user_id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var ChannelMemberRels = struct {
	Channel string
	User    string
}{
	Channel: "Channel",
	User:    "User",
}

ChannelMemberRels is where relationship names are stored.

View Source
var ChannelMemberWhere = struct {
	ChannelID whereHelperint
	UserID    whereHelperint
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ChannelID: whereHelperint{/* contains filtered or unexported fields */},
	UserID:    whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var ChannelPermissionColumns = struct {
	ChannelID  string
	UserID     string
	Permission string
	CreatedAt  string
	UpdatedAt  string
	DeletedAt  string
}{
	ChannelID:  "channel_id",
	UserID:     "user_id",
	Permission: "permission",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
	DeletedAt:  "deleted_at",
}
View Source
var ChannelPermissionRels = struct {
	Channel string
	User    string
}{
	Channel: "Channel",
	User:    "User",
}

ChannelPermissionRels is where relationship names are stored.

View Source
var ChannelPermissionWhere = struct {
	ChannelID  whereHelperint
	UserID     whereHelperint
	Permission whereHelpernull_Int
	CreatedAt  whereHelpernull_Time
	UpdatedAt  whereHelpernull_Time
	DeletedAt  whereHelpernull_Time
}{
	ChannelID:  whereHelperint{/* contains filtered or unexported fields */},
	UserID:     whereHelperint{/* contains filtered or unexported fields */},
	Permission: whereHelpernull_Int{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var ChannelRels = struct {
	Creator            string
	ChannelMembers     string
	ChannelPermissions string
	DSTMessages        string
}{
	Creator:            "Creator",
	ChannelMembers:     "ChannelMembers",
	ChannelPermissions: "ChannelPermissions",
	DSTMessages:        "DSTMessages",
}

ChannelRels is where relationship names are stored.

View Source
var ChannelWhere = struct {
	ID        whereHelperint
	CreatorID whereHelpernull_Int
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	CreatorID: whereHelpernull_Int{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
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 MessageColumns = struct {
	ID        string
	OriginID  string
	DSTID     string
	ParentID  string
	Body      string
	State     string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	OriginID:  "origin_id",
	DSTID:     "dst_id",
	ParentID:  "parent_id",
	Body:      "body",
	State:     "state",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var MessageRels = struct {
	DST            string
	Origin         string
	Parent         string
	ParentMessages string
}{
	DST:            "DST",
	Origin:         "Origin",
	Parent:         "Parent",
	ParentMessages: "ParentMessages",
}

MessageRels is where relationship names are stored.

View Source
var MessageWhere = struct {
	ID        whereHelperint
	OriginID  whereHelpernull_Int
	DSTID     whereHelpernull_Int
	ParentID  whereHelpernull_Int
	Body      whereHelpernull_String
	State     whereHelpernull_Int
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	OriginID:  whereHelpernull_Int{/* contains filtered or unexported fields */},
	DSTID:     whereHelpernull_Int{/* contains filtered or unexported fields */},
	ParentID:  whereHelpernull_Int{/* contains filtered or unexported fields */},
	Body:      whereHelpernull_String{/* contains filtered or unexported fields */},
	State:     whereHelpernull_Int{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var MigrationColumns = struct {
	Version string
	Dirty   string
}{
	Version: "version",
	Dirty:   "dirty",
}
View Source
var MigrationRels = struct {
}{}

MigrationRels is where relationship names are stored.

View Source
var MigrationWhere = struct {
	Version whereHelperint64
	Dirty   whereHelperbool
}{
	Version: whereHelperint64{/* contains filtered or unexported fields */},
	Dirty:   whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var RoleColumns = struct {
	ID        string
	Name      string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	Name:      "name",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var RoleRels = struct {
	UserRoles string
}{
	UserRoles: "UserRoles",
}

RoleRels is where relationship names are stored.

View Source
var RoleWhere = struct {
	ID        whereHelperint
	Name      whereHelperstring
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	ChannelMembers     string
	ChannelPermissions string
	Channels           string
	Messages           string
	Migrations         string
	Roles              string
	UserRole           string
	Users              string
}{
	ChannelMembers:     "channel_members",
	ChannelPermissions: "channel_permissions",
	Channels:           "channels",
	Messages:           "messages",
	Migrations:         "migrations",
	Roles:              "roles",
	UserRole:           "user_role",
	Users:              "users",
}
View Source
var UserColumns = struct {
	ID          string
	PhoneNumber string
	Username    string
	Password    string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   string
}{
	ID:          "id",
	PhoneNumber: "phone_number",
	Username:    "username",
	Password:    "password",
	CreatedAt:   "created_at",
	UpdatedAt:   "updated_at",
	DeletedAt:   "deleted_at",
}
View Source
var UserRels = struct {
	ChannelMembers     string
	ChannelPermissions string
	CreatorChannels    string
	OriginMessages     string
	UserRoles          string
}{
	ChannelMembers:     "ChannelMembers",
	ChannelPermissions: "ChannelPermissions",
	CreatorChannels:    "CreatorChannels",
	OriginMessages:     "OriginMessages",
	UserRoles:          "UserRoles",
}

UserRels is where relationship names are stored.

View Source
var UserRoleColumns = struct {
	UserID    string
	RoleID    string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	UserID:    "user_id",
	RoleID:    "role_id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
View Source
var UserRoleRels = struct {
	Role string
	User string
}{
	Role: "Role",
	User: "User",
}

UserRoleRels is where relationship names are stored.

View Source
var UserRoleWhere = struct {
	UserID    whereHelperint
	RoleID    whereHelperint
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	DeletedAt whereHelpernull_Time
}{
	UserID:    whereHelperint{/* contains filtered or unexported fields */},
	RoleID:    whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var UserWhere = struct {
	ID          whereHelperint
	PhoneNumber whereHelperstring
	Username    whereHelperstring
	Password    whereHelperstring
	CreatedAt   whereHelpernull_Time
	UpdatedAt   whereHelpernull_Time
	DeletedAt   whereHelpernull_Time
}{
	ID:          whereHelperint{/* contains filtered or unexported fields */},
	PhoneNumber: whereHelperstring{/* contains filtered or unexported fields */},
	Username:    whereHelperstring{/* contains filtered or unexported fields */},
	Password:    whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
	DeletedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
}

Functions

func AddChannelHook

func AddChannelHook(hookPoint boil.HookPoint, channelHook ChannelHook)

AddChannelHook registers your hook function for all future operations.

func AddChannelMemberHook

func AddChannelMemberHook(hookPoint boil.HookPoint, channelMemberHook ChannelMemberHook)

AddChannelMemberHook registers your hook function for all future operations.

func AddChannelPermissionHook

func AddChannelPermissionHook(hookPoint boil.HookPoint, channelPermissionHook ChannelPermissionHook)

AddChannelPermissionHook registers your hook function for all future operations.

func AddMessageHook

func AddMessageHook(hookPoint boil.HookPoint, messageHook MessageHook)

AddMessageHook registers your hook function for all future operations.

func AddMigrationHook

func AddMigrationHook(hookPoint boil.HookPoint, migrationHook MigrationHook)

AddMigrationHook registers your hook function for all future operations.

func AddRoleHook

func AddRoleHook(hookPoint boil.HookPoint, roleHook RoleHook)

AddRoleHook 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 AddUserRoleHook

func AddUserRoleHook(hookPoint boil.HookPoint, userRoleHook UserRoleHook)

AddUserRoleHook registers your hook function for all future operations.

func ChannelExists

func ChannelExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

ChannelExists checks if the Channel row exists.

func ChannelMemberExists

func ChannelMemberExists(ctx context.Context, exec boil.ContextExecutor, channelID int, userID int) (bool, error)

ChannelMemberExists checks if the ChannelMember row exists.

func ChannelMembers

func ChannelMembers(mods ...qm.QueryMod) channelMemberQuery

ChannelMembers retrieves all the records using an executor.

func ChannelPermissionExists

func ChannelPermissionExists(ctx context.Context, exec boil.ContextExecutor, channelID int, userID int) (bool, error)

ChannelPermissionExists checks if the ChannelPermission row exists.

func ChannelPermissions

func ChannelPermissions(mods ...qm.QueryMod) channelPermissionQuery

ChannelPermissions retrieves all the records using an executor.

func Channels

func Channels(mods ...qm.QueryMod) channelQuery

Channels retrieves all the records using an executor.

func MessageExists

func MessageExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

MessageExists checks if the Message row exists.

func Messages

func Messages(mods ...qm.QueryMod) messageQuery

Messages retrieves all the records using an executor.

func MigrationExists

func MigrationExists(ctx context.Context, exec boil.ContextExecutor, version int64) (bool, error)

MigrationExists checks if the Migration row exists.

func Migrations

func Migrations(mods ...qm.QueryMod) migrationQuery

Migrations 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 RoleExists

func RoleExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

RoleExists checks if the Role row exists.

func Roles

func Roles(mods ...qm.QueryMod) roleQuery

Roles retrieves all the records using an executor.

func UserExists

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

UserExists checks if the User row exists.

func UserRoleExists

func UserRoleExists(ctx context.Context, exec boil.ContextExecutor, userID int, roleID int) (bool, error)

UserRoleExists checks if the UserRole row exists.

func UserRoles

func UserRoles(mods ...qm.QueryMod) userRoleQuery

UserRoles retrieves all the records using an executor.

func Users

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

Users retrieves all the records using an executor.

Types

type Channel

type Channel struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatorID null.Int  `boil:"creator_id" json:"creator_id,omitempty" toml:"creator_id" yaml:"creator_id,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"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *channelR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L channelL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Channel is an object representing the database table.

func FindChannel

func FindChannel(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Channel, error)

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

func (*Channel) AddChannelMembers

func (o *Channel) AddChannelMembers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*ChannelMember) error

AddChannelMembers adds the given related objects to the existing relationships of the channel, optionally inserting them as new records. Appends related to o.R.ChannelMembers. Sets related.R.Channel appropriately.

func (*Channel) AddChannelPermissions

func (o *Channel) AddChannelPermissions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*ChannelPermission) error

AddChannelPermissions adds the given related objects to the existing relationships of the channel, optionally inserting them as new records. Appends related to o.R.ChannelPermissions. Sets related.R.Channel appropriately.

func (*Channel) AddDSTMessages

func (o *Channel) AddDSTMessages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Message) error

AddDSTMessages adds the given related objects to the existing relationships of the channel, optionally inserting them as new records. Appends related to o.R.DSTMessages. Sets related.R.DST appropriately.

func (*Channel) ChannelMembers

func (o *Channel) ChannelMembers(mods ...qm.QueryMod) channelMemberQuery

ChannelMembers retrieves all the channel_member's ChannelMembers with an executor.

func (*Channel) ChannelPermissions

func (o *Channel) ChannelPermissions(mods ...qm.QueryMod) channelPermissionQuery

ChannelPermissions retrieves all the channel_permission's ChannelPermissions with an executor.

func (*Channel) Creator

func (o *Channel) Creator(mods ...qm.QueryMod) userQuery

Creator pointed to by the foreign key.

func (*Channel) DSTMessages

func (o *Channel) DSTMessages(mods ...qm.QueryMod) messageQuery

DSTMessages retrieves all the message's Messages with an executor via dst_id column.

func (*Channel) Delete

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

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

func (*Channel) Insert

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

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

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

func (*Channel) RemoveCreator

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

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

func (*Channel) RemoveDSTMessages

func (o *Channel) RemoveDSTMessages(ctx context.Context, exec boil.ContextExecutor, related ...*Message) error

RemoveDSTMessages relationships from objects passed in. Removes related items from R.DSTMessages (uses pointer comparison, removal does not keep order) Sets related.R.DST.

func (*Channel) SetCreator

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

SetCreator of the channel to the related item. Sets o.R.Creator to related. Adds o to related.R.CreatorChannels.

func (*Channel) SetDSTMessages

func (o *Channel) SetDSTMessages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Message) error

SetDSTMessages removes all previously related items of the channel replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.DST's DSTMessages accordingly. Replaces o.R.DSTMessages with related. Sets related.R.DST's DSTMessages accordingly.

func (*Channel) Update

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

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

func (o *Channel) 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 ChannelHook

type ChannelHook func(context.Context, boil.ContextExecutor, *Channel) error

ChannelHook is the signature for custom Channel hook methods

type ChannelMember

type ChannelMember struct {
	ChannelID int       `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	UserID    int       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	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"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *channelMemberR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L channelMemberL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ChannelMember is an object representing the database table.

func FindChannelMember

func FindChannelMember(ctx context.Context, exec boil.ContextExecutor, channelID int, userID int, selectCols ...string) (*ChannelMember, error)

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

func (*ChannelMember) Channel

func (o *ChannelMember) Channel(mods ...qm.QueryMod) channelQuery

Channel pointed to by the foreign key.

func (*ChannelMember) Delete

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

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

func (*ChannelMember) Insert

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

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

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

func (*ChannelMember) SetChannel

func (o *ChannelMember) SetChannel(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Channel) error

SetChannel of the channelMember to the related item. Sets o.R.Channel to related. Adds o to related.R.ChannelMembers.

func (*ChannelMember) SetUser

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

SetUser of the channelMember to the related item. Sets o.R.User to related. Adds o to related.R.ChannelMembers.

func (*ChannelMember) Update

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

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

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

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

User pointed to by the foreign key.

type ChannelMemberHook

type ChannelMemberHook func(context.Context, boil.ContextExecutor, *ChannelMember) error

ChannelMemberHook is the signature for custom ChannelMember hook methods

type ChannelMemberSlice

type ChannelMemberSlice []*ChannelMember

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

func (ChannelMemberSlice) DeleteAll

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

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

func (*ChannelMemberSlice) ReloadAll

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

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

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

type ChannelPermission

type ChannelPermission struct {
	ChannelID  int       `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	UserID     int       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	Permission null.Int  `boil:"permission" json:"permission,omitempty" toml:"permission" yaml:"permission,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"`
	DeletedAt  null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *channelPermissionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L channelPermissionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ChannelPermission is an object representing the database table.

func FindChannelPermission

func FindChannelPermission(ctx context.Context, exec boil.ContextExecutor, channelID int, userID int, selectCols ...string) (*ChannelPermission, error)

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

func (*ChannelPermission) Channel

func (o *ChannelPermission) Channel(mods ...qm.QueryMod) channelQuery

Channel pointed to by the foreign key.

func (*ChannelPermission) Delete

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

func (*ChannelPermission) Insert

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

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

func (*ChannelPermission) SetChannel

func (o *ChannelPermission) SetChannel(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Channel) error

SetChannel of the channelPermission to the related item. Sets o.R.Channel to related. Adds o to related.R.ChannelPermissions.

func (*ChannelPermission) SetUser

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

SetUser of the channelPermission to the related item. Sets o.R.User to related. Adds o to related.R.ChannelPermissions.

func (*ChannelPermission) Update

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

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

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

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

User pointed to by the foreign key.

type ChannelPermissionHook

type ChannelPermissionHook func(context.Context, boil.ContextExecutor, *ChannelPermission) error

ChannelPermissionHook is the signature for custom ChannelPermission hook methods

type ChannelPermissionSlice

type ChannelPermissionSlice []*ChannelPermission

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

func (ChannelPermissionSlice) DeleteAll

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

func (*ChannelPermissionSlice) ReloadAll

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (ChannelPermissionSlice) UpdateAll

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

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

type ChannelSlice

type ChannelSlice []*Channel

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

func (ChannelSlice) DeleteAll

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

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

func (*ChannelSlice) ReloadAll

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

func (o ChannelSlice) 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 Message

type Message struct {
	ID        int         `boil:"id" json:"id" toml:"id" yaml:"id"`
	OriginID  null.Int    `boil:"origin_id" json:"origin_id,omitempty" toml:"origin_id" yaml:"origin_id,omitempty"`
	DSTID     null.Int    `boil:"dst_id" json:"dst_id,omitempty" toml:"dst_id" yaml:"dst_id,omitempty"`
	ParentID  null.Int    `boil:"parent_id" json:"parent_id,omitempty" toml:"parent_id" yaml:"parent_id,omitempty"`
	Body      null.String `boil:"body" json:"body,omitempty" toml:"body" yaml:"body,omitempty"`
	State     null.Int    `boil:"state" json:"state,omitempty" toml:"state" yaml:"state,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"`
	DeletedAt null.Time   `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *messageR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L messageL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Message is an object representing the database table.

func FindMessage

func FindMessage(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Message, error)

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

func (*Message) AddParentMessages

func (o *Message) AddParentMessages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Message) error

AddParentMessages adds the given related objects to the existing relationships of the message, optionally inserting them as new records. Appends related to o.R.ParentMessages. Sets related.R.Parent appropriately.

func (*Message) DST

func (o *Message) DST(mods ...qm.QueryMod) channelQuery

DST pointed to by the foreign key.

func (*Message) Delete

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

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

func (*Message) Insert

func (o *Message) 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 (*Message) Origin

func (o *Message) Origin(mods ...qm.QueryMod) userQuery

Origin pointed to by the foreign key.

func (*Message) Parent

func (o *Message) Parent(mods ...qm.QueryMod) messageQuery

Parent pointed to by the foreign key.

func (*Message) ParentMessages

func (o *Message) ParentMessages(mods ...qm.QueryMod) messageQuery

ParentMessages retrieves all the message's Messages with an executor via parent_id column.

func (*Message) Reload

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

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

func (*Message) RemoveDST

func (o *Message) RemoveDST(ctx context.Context, exec boil.ContextExecutor, related *Channel) error

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

func (*Message) RemoveOrigin

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

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

func (*Message) RemoveParent

func (o *Message) RemoveParent(ctx context.Context, exec boil.ContextExecutor, related *Message) error

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

func (*Message) RemoveParentMessages

func (o *Message) RemoveParentMessages(ctx context.Context, exec boil.ContextExecutor, related ...*Message) error

RemoveParentMessages relationships from objects passed in. Removes related items from R.ParentMessages (uses pointer comparison, removal does not keep order) Sets related.R.Parent.

func (*Message) SetDST

func (o *Message) SetDST(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Channel) error

SetDST of the message to the related item. Sets o.R.DST to related. Adds o to related.R.DSTMessages.

func (*Message) SetOrigin

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

SetOrigin of the message to the related item. Sets o.R.Origin to related. Adds o to related.R.OriginMessages.

func (*Message) SetParent

func (o *Message) SetParent(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Message) error

SetParent of the message to the related item. Sets o.R.Parent to related. Adds o to related.R.ParentMessages.

func (*Message) SetParentMessages

func (o *Message) SetParentMessages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Message) error

SetParentMessages removes all previously related items of the message replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Parent's ParentMessages accordingly. Replaces o.R.ParentMessages with related. Sets related.R.Parent's ParentMessages accordingly.

func (*Message) Update

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

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

func (o *Message) 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 MessageHook

type MessageHook func(context.Context, boil.ContextExecutor, *Message) error

MessageHook is the signature for custom Message hook methods

type MessageSlice

type MessageSlice []*Message

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

func (MessageSlice) DeleteAll

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

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

func (*MessageSlice) ReloadAll

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

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

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

type Migration

type Migration struct {
	Version int64 `boil:"version" json:"version" toml:"version" yaml:"version"`
	Dirty   bool  `boil:"dirty" json:"dirty" toml:"dirty" yaml:"dirty"`

	R *migrationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L migrationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Migration is an object representing the database table.

func FindMigration

func FindMigration(ctx context.Context, exec boil.ContextExecutor, version int64, selectCols ...string) (*Migration, error)

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

func (*Migration) Delete

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

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

func (*Migration) Insert

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

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

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

func (*Migration) Update

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

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

func (o *Migration) 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 MigrationHook

type MigrationHook func(context.Context, boil.ContextExecutor, *Migration) error

MigrationHook is the signature for custom Migration hook methods

type MigrationSlice

type MigrationSlice []*Migration

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

func (MigrationSlice) DeleteAll

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

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

func (*MigrationSlice) ReloadAll

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

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

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

type Role

type Role struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	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"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *roleR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L roleL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Role is an object representing the database table.

func FindRole

func FindRole(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Role, error)

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

func (*Role) AddUserRoles

func (o *Role) AddUserRoles(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*UserRole) error

AddUserRoles adds the given related objects to the existing relationships of the role, optionally inserting them as new records. Appends related to o.R.UserRoles. Sets related.R.Role appropriately.

func (*Role) Delete

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

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

func (*Role) Insert

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

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

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

func (*Role) Update

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

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

func (o *Role) 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 (*Role) UserRoles

func (o *Role) UserRoles(mods ...qm.QueryMod) userRoleQuery

UserRoles retrieves all the user_role's UserRoles with an executor.

type RoleHook

type RoleHook func(context.Context, boil.ContextExecutor, *Role) error

RoleHook is the signature for custom Role hook methods

type RoleSlice

type RoleSlice []*Role

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

func (RoleSlice) DeleteAll

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

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

func (*RoleSlice) ReloadAll

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

func (o RoleSlice) 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          int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	PhoneNumber string    `boil:"phone_number" json:"phone_number" toml:"phone_number" yaml:"phone_number"`
	Username    string    `boil:"username" json:"username" toml:"username" yaml:"username"`
	Password    string    `boil:"password" json:"password" toml:"password" yaml:"password"`
	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"`
	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 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) AddChannelMembers

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

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

func (*User) AddChannelPermissions

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

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

func (*User) AddCreatorChannels

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

AddCreatorChannels adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.CreatorChannels. Sets related.R.Creator appropriately.

func (*User) AddOriginMessages

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

AddOriginMessages adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.OriginMessages. Sets related.R.Origin appropriately.

func (*User) AddUserRoles

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

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

func (*User) ChannelMembers

func (o *User) ChannelMembers(mods ...qm.QueryMod) channelMemberQuery

ChannelMembers retrieves all the channel_member's ChannelMembers with an executor.

func (*User) ChannelPermissions

func (o *User) ChannelPermissions(mods ...qm.QueryMod) channelPermissionQuery

ChannelPermissions retrieves all the channel_permission's ChannelPermissions with an executor.

func (*User) CreatorChannels

func (o *User) CreatorChannels(mods ...qm.QueryMod) channelQuery

CreatorChannels retrieves all the channel's Channels with an executor via creator_id column.

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

func (o *User) OriginMessages(mods ...qm.QueryMod) messageQuery

OriginMessages retrieves all the message's Messages with an executor via origin_id column.

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

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

RemoveCreatorChannels relationships from objects passed in. Removes related items from R.CreatorChannels (uses pointer comparison, removal does not keep order) Sets related.R.Creator.

func (*User) RemoveOriginMessages

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

RemoveOriginMessages relationships from objects passed in. Removes related items from R.OriginMessages (uses pointer comparison, removal does not keep order) Sets related.R.Origin.

func (*User) SetCreatorChannels

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

SetCreatorChannels 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.Creator's CreatorChannels accordingly. Replaces o.R.CreatorChannels with related. Sets related.R.Creator's CreatorChannels accordingly.

func (*User) SetOriginMessages

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

SetOriginMessages 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.Origin's OriginMessages accordingly. Replaces o.R.OriginMessages with related. Sets related.R.Origin's OriginMessages 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.

func (*User) UserRoles

func (o *User) UserRoles(mods ...qm.QueryMod) userRoleQuery

UserRoles retrieves all the user_role's UserRoles with an executor.

type UserHook

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

UserHook is the signature for custom User hook methods

type UserRole

type UserRole struct {
	UserID    int       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	RoleID    int       `boil:"role_id" json:"role_id" toml:"role_id" yaml:"role_id"`
	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"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`

	R *userRoleR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userRoleL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

UserRole is an object representing the database table.

func FindUserRole

func FindUserRole(ctx context.Context, exec boil.ContextExecutor, userID int, roleID int, selectCols ...string) (*UserRole, error)

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

func (*UserRole) Delete

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

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

func (*UserRole) Insert

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

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

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

func (*UserRole) Role

func (o *UserRole) Role(mods ...qm.QueryMod) roleQuery

Role pointed to by the foreign key.

func (*UserRole) SetRole

func (o *UserRole) SetRole(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Role) error

SetRole of the userRole to the related item. Sets o.R.Role to related. Adds o to related.R.UserRoles.

func (*UserRole) SetUser

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

SetUser of the userRole to the related item. Sets o.R.User to related. Adds o to related.R.UserRoles.

func (*UserRole) Update

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

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

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

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

User pointed to by the foreign key.

type UserRoleHook

type UserRoleHook func(context.Context, boil.ContextExecutor, *UserRole) error

UserRoleHook is the signature for custom UserRole hook methods

type UserRoleSlice

type UserRoleSlice []*UserRole

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

func (UserRoleSlice) DeleteAll

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

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

func (*UserRoleSlice) ReloadAll

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

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

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

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