models

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var ReputationConfigColumns = struct {
	GuildID                 string
	PointsName              string
	Enabled                 string
	Cooldown                string
	MaxGiveAmount           string
	RequiredGiveRole        string
	RequiredReceiveRole     string
	BlacklistedGiveRole     string
	BlacklistedReceiveRole  string
	AdminRole               string
	DisableThanksDetection  string
	MaxRemoveAmount         string
	AdminRoles              string
	RequiredGiveRoles       string
	RequiredReceiveRoles    string
	BlacklistedGiveRoles    string
	BlacklistedReceiveRoles string
}{
	GuildID:                 "guild_id",
	PointsName:              "points_name",
	Enabled:                 "enabled",
	Cooldown:                "cooldown",
	MaxGiveAmount:           "max_give_amount",
	RequiredGiveRole:        "required_give_role",
	RequiredReceiveRole:     "required_receive_role",
	BlacklistedGiveRole:     "blacklisted_give_role",
	BlacklistedReceiveRole:  "blacklisted_receive_role",
	AdminRole:               "admin_role",
	DisableThanksDetection:  "disable_thanks_detection",
	MaxRemoveAmount:         "max_remove_amount",
	AdminRoles:              "admin_roles",
	RequiredGiveRoles:       "required_give_roles",
	RequiredReceiveRoles:    "required_receive_roles",
	BlacklistedGiveRoles:    "blacklisted_give_roles",
	BlacklistedReceiveRoles: "blacklisted_receive_roles",
}
View Source
var ReputationConfigRels = struct {
}{}

ReputationConfigRels is where relationship names are stored.

View Source
var ReputationLogColumns = struct {
	ID               string
	CreatedAt        string
	GuildID          string
	SenderID         string
	ReceiverID       string
	SetFixedAmount   string
	Amount           string
	ReceiverUsername string
	SenderUsername   string
}{
	ID:               "id",
	CreatedAt:        "created_at",
	GuildID:          "guild_id",
	SenderID:         "sender_id",
	ReceiverID:       "receiver_id",
	SetFixedAmount:   "set_fixed_amount",
	Amount:           "amount",
	ReceiverUsername: "receiver_username",
	SenderUsername:   "sender_username",
}
View Source
var ReputationLogRels = struct {
}{}

ReputationLogRels is where relationship names are stored.

View Source
var ReputationUserColumns = struct {
	UserID    string
	GuildID   string
	CreatedAt string
	Points    string
}{
	UserID:    "user_id",
	GuildID:   "guild_id",
	CreatedAt: "created_at",
	Points:    "points",
}
View Source
var ReputationUserRels = struct {
}{}

ReputationUserRels is where relationship names are stored.

View Source
var TableNames = struct {
	ReputationConfigs string
	ReputationLog     string
	ReputationUsers   string
}{
	ReputationConfigs: "reputation_configs",
	ReputationLog:     "reputation_log",
	ReputationUsers:   "reputation_users",
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func ReputationConfigExists

func ReputationConfigExists(ctx context.Context, exec boil.ContextExecutor, guildID int64) (bool, error)

ReputationConfigExists checks if the ReputationConfig row exists.

func ReputationConfigExistsG

func ReputationConfigExistsG(ctx context.Context, guildID int64) (bool, error)

ReputationConfigExistsG checks if the ReputationConfig row exists.

func ReputationConfigs

func ReputationConfigs(mods ...qm.QueryMod) reputationConfigQuery

ReputationConfigs retrieves all the records using an executor.

func ReputationLogExists

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

ReputationLogExists checks if the ReputationLog row exists.

func ReputationLogExistsG

func ReputationLogExistsG(ctx context.Context, iD int64) (bool, error)

ReputationLogExistsG checks if the ReputationLog row exists.

func ReputationLogs

func ReputationLogs(mods ...qm.QueryMod) reputationLogQuery

ReputationLogs retrieves all the records using an executor.

func ReputationUserExists

func ReputationUserExists(ctx context.Context, exec boil.ContextExecutor, guildID int64, userID int64) (bool, error)

ReputationUserExists checks if the ReputationUser row exists.

func ReputationUserExistsG

func ReputationUserExistsG(ctx context.Context, guildID int64, userID int64) (bool, error)

ReputationUserExistsG checks if the ReputationUser row exists.

func ReputationUsers

func ReputationUsers(mods ...qm.QueryMod) reputationUserQuery

ReputationUsers retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

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

type ReputationConfig

type ReputationConfig struct {
	GuildID                 int64            `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	PointsName              string           `boil:"points_name" json:"points_name" toml:"points_name" yaml:"points_name"`
	Enabled                 bool             `boil:"enabled" json:"enabled" toml:"enabled" yaml:"enabled"`
	Cooldown                int              `boil:"cooldown" json:"cooldown" toml:"cooldown" yaml:"cooldown"`
	MaxGiveAmount           int64            `boil:"max_give_amount" json:"max_give_amount" toml:"max_give_amount" yaml:"max_give_amount"`
	RequiredGiveRole        null.String      `boil:"required_give_role" json:"required_give_role,omitempty" toml:"required_give_role" yaml:"required_give_role,omitempty"`
	RequiredReceiveRole     null.String      `` /* 135-byte string literal not displayed */
	BlacklistedGiveRole     null.String      `` /* 135-byte string literal not displayed */
	BlacklistedReceiveRole  null.String      `` /* 147-byte string literal not displayed */
	AdminRole               null.String      `boil:"admin_role" json:"admin_role,omitempty" toml:"admin_role" yaml:"admin_role,omitempty"`
	DisableThanksDetection  bool             `` /* 127-byte string literal not displayed */
	MaxRemoveAmount         int64            `boil:"max_remove_amount" json:"max_remove_amount" toml:"max_remove_amount" yaml:"max_remove_amount"`
	AdminRoles              types.Int64Array `boil:"admin_roles" json:"admin_roles,omitempty" toml:"admin_roles" yaml:"admin_roles,omitempty"`
	RequiredGiveRoles       types.Int64Array `` /* 127-byte string literal not displayed */
	RequiredReceiveRoles    types.Int64Array `` /* 139-byte string literal not displayed */
	BlacklistedGiveRoles    types.Int64Array `` /* 139-byte string literal not displayed */
	BlacklistedReceiveRoles types.Int64Array `` /* 151-byte string literal not displayed */

	R *reputationConfigR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L reputationConfigL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ReputationConfig is an object representing the database table.

func FindReputationConfig

func FindReputationConfig(ctx context.Context, exec boil.ContextExecutor, guildID int64, selectCols ...string) (*ReputationConfig, error)

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

func FindReputationConfigG

func FindReputationConfigG(ctx context.Context, guildID int64, selectCols ...string) (*ReputationConfig, error)

FindReputationConfigG retrieves a single record by ID.

func (*ReputationConfig) Delete

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

func (*ReputationConfig) DeleteG

func (o *ReputationConfig) DeleteG(ctx context.Context) (int64, error)

DeleteG deletes a single ReputationConfig record. DeleteG will match against the primary key column to find the record to delete.

func (*ReputationConfig) Insert

func (o *ReputationConfig) 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 (*ReputationConfig) InsertG

func (o *ReputationConfig) InsertG(ctx context.Context, columns boil.Columns) error

InsertG a single record. See Insert for whitelist behavior description.

func (*ReputationConfig) Reload

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

func (*ReputationConfig) ReloadG

func (o *ReputationConfig) ReloadG(ctx context.Context) error

ReloadG refetches the object from the database using the primary keys.

func (*ReputationConfig) Update

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

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

func (o *ReputationConfig) UpdateG(ctx context.Context, columns boil.Columns) (int64, error)

UpdateG a single ReputationConfig record using the global executor. See Update for more documentation.

func (*ReputationConfig) Upsert

func (o *ReputationConfig) 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 (*ReputationConfig) UpsertG

func (o *ReputationConfig) UpsertG(ctx context.Context, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

UpsertG attempts an insert, and does an update or ignore on conflict.

type ReputationConfigSlice

type ReputationConfigSlice []*ReputationConfig

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

func (ReputationConfigSlice) DeleteAll

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

func (ReputationConfigSlice) DeleteAllG

func (o ReputationConfigSlice) DeleteAllG(ctx context.Context) (int64, error)

DeleteAllG deletes all rows in the slice.

func (*ReputationConfigSlice) ReloadAll

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

func (*ReputationConfigSlice) ReloadAllG

func (o *ReputationConfigSlice) ReloadAllG(ctx context.Context) error

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

func (ReputationConfigSlice) UpdateAll

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

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

func (ReputationConfigSlice) UpdateAllG

func (o ReputationConfigSlice) UpdateAllG(ctx context.Context, cols M) (int64, error)

UpdateAllG updates all rows with the specified column values.

type ReputationLog

type ReputationLog struct {
	ID               int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt        time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	GuildID          int64     `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	SenderID         int64     `boil:"sender_id" json:"sender_id" toml:"sender_id" yaml:"sender_id"`
	ReceiverID       int64     `boil:"receiver_id" json:"receiver_id" toml:"receiver_id" yaml:"receiver_id"`
	SetFixedAmount   bool      `boil:"set_fixed_amount" json:"set_fixed_amount" toml:"set_fixed_amount" yaml:"set_fixed_amount"`
	Amount           int64     `boil:"amount" json:"amount" toml:"amount" yaml:"amount"`
	ReceiverUsername string    `boil:"receiver_username" json:"receiver_username" toml:"receiver_username" yaml:"receiver_username"`
	SenderUsername   string    `boil:"sender_username" json:"sender_username" toml:"sender_username" yaml:"sender_username"`

	R *reputationLogR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L reputationLogL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ReputationLog is an object representing the database table.

func FindReputationLog

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

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

func FindReputationLogG

func FindReputationLogG(ctx context.Context, iD int64, selectCols ...string) (*ReputationLog, error)

FindReputationLogG retrieves a single record by ID.

func (*ReputationLog) Delete

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

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

func (*ReputationLog) DeleteG

func (o *ReputationLog) DeleteG(ctx context.Context) (int64, error)

DeleteG deletes a single ReputationLog record. DeleteG will match against the primary key column to find the record to delete.

func (*ReputationLog) Insert

func (o *ReputationLog) 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 (*ReputationLog) InsertG

func (o *ReputationLog) InsertG(ctx context.Context, columns boil.Columns) error

InsertG a single record. See Insert for whitelist behavior description.

func (*ReputationLog) Reload

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

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

func (*ReputationLog) ReloadG

func (o *ReputationLog) ReloadG(ctx context.Context) error

ReloadG refetches the object from the database using the primary keys.

func (*ReputationLog) Update

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

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

func (o *ReputationLog) UpdateG(ctx context.Context, columns boil.Columns) (int64, error)

UpdateG a single ReputationLog record using the global executor. See Update for more documentation.

func (*ReputationLog) Upsert

func (o *ReputationLog) 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 (*ReputationLog) UpsertG

func (o *ReputationLog) UpsertG(ctx context.Context, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

UpsertG attempts an insert, and does an update or ignore on conflict.

type ReputationLogSlice

type ReputationLogSlice []*ReputationLog

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

func (ReputationLogSlice) DeleteAll

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

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

func (ReputationLogSlice) DeleteAllG

func (o ReputationLogSlice) DeleteAllG(ctx context.Context) (int64, error)

DeleteAllG deletes all rows in the slice.

func (*ReputationLogSlice) ReloadAll

func (o *ReputationLogSlice) 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 (*ReputationLogSlice) ReloadAllG

func (o *ReputationLogSlice) ReloadAllG(ctx context.Context) error

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

func (ReputationLogSlice) UpdateAll

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

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

func (ReputationLogSlice) UpdateAllG

func (o ReputationLogSlice) UpdateAllG(ctx context.Context, cols M) (int64, error)

UpdateAllG updates all rows with the specified column values.

type ReputationUser

type ReputationUser struct {
	UserID    int64     `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	GuildID   int64     `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	Points    int64     `boil:"points" json:"points" toml:"points" yaml:"points"`

	R *reputationUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L reputationUserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ReputationUser is an object representing the database table.

func FindReputationUser

func FindReputationUser(ctx context.Context, exec boil.ContextExecutor, guildID int64, userID int64, selectCols ...string) (*ReputationUser, error)

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

func FindReputationUserG

func FindReputationUserG(ctx context.Context, guildID int64, userID int64, selectCols ...string) (*ReputationUser, error)

FindReputationUserG retrieves a single record by ID.

func (*ReputationUser) Delete

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

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

func (*ReputationUser) DeleteG

func (o *ReputationUser) DeleteG(ctx context.Context) (int64, error)

DeleteG deletes a single ReputationUser record. DeleteG will match against the primary key column to find the record to delete.

func (*ReputationUser) Insert

func (o *ReputationUser) 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 (*ReputationUser) InsertG

func (o *ReputationUser) InsertG(ctx context.Context, columns boil.Columns) error

InsertG a single record. See Insert for whitelist behavior description.

func (*ReputationUser) Reload

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

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

func (*ReputationUser) ReloadG

func (o *ReputationUser) ReloadG(ctx context.Context) error

ReloadG refetches the object from the database using the primary keys.

func (*ReputationUser) Update

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

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

func (o *ReputationUser) UpdateG(ctx context.Context, columns boil.Columns) (int64, error)

UpdateG a single ReputationUser record using the global executor. See Update for more documentation.

func (*ReputationUser) Upsert

func (o *ReputationUser) 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 (*ReputationUser) UpsertG

func (o *ReputationUser) UpsertG(ctx context.Context, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

UpsertG attempts an insert, and does an update or ignore on conflict.

type ReputationUserSlice

type ReputationUserSlice []*ReputationUser

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

func (ReputationUserSlice) DeleteAll

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

func (ReputationUserSlice) DeleteAllG

func (o ReputationUserSlice) DeleteAllG(ctx context.Context) (int64, error)

DeleteAllG deletes all rows in the slice.

func (*ReputationUserSlice) ReloadAll

func (o *ReputationUserSlice) 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 (*ReputationUserSlice) ReloadAllG

func (o *ReputationUserSlice) ReloadAllG(ctx context.Context) error

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

func (ReputationUserSlice) UpdateAll

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

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

func (ReputationUserSlice) UpdateAllG

func (o ReputationUserSlice) UpdateAllG(ctx context.Context, cols M) (int64, error)

UpdateAllG updates all rows with the specified column values.

Jump to

Keyboard shortcuts

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