models

package
v1.19.17 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 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 TableNames = struct {
	VerificationConfigs  string
	VerificationSessions string
	VerifiedUsers        string
}{
	VerificationConfigs:  "verification_configs",
	VerificationSessions: "verification_sessions",
	VerifiedUsers:        "verified_users",
}
View Source
var VerificationConfigColumns = struct {
	GuildID             string
	Enabled             string
	VerifiedRole        string
	PageContent         string
	KickUnverifiedAfter string
	WarnUnverifiedAfter string
	WarnMessage         string
	LogChannel          string
	DMMessage           string
}{
	GuildID:             "guild_id",
	Enabled:             "enabled",
	VerifiedRole:        "verified_role",
	PageContent:         "page_content",
	KickUnverifiedAfter: "kick_unverified_after",
	WarnUnverifiedAfter: "warn_unverified_after",
	WarnMessage:         "warn_message",
	LogChannel:          "log_channel",
	DMMessage:           "dm_message",
}
View Source
var VerificationConfigRels = struct {
}{}

VerificationConfigRels is where relationship names are stored.

View Source
var VerificationConfigWhere = struct {
	GuildID             whereHelperint64
	Enabled             whereHelperbool
	VerifiedRole        whereHelperint64
	PageContent         whereHelperstring
	KickUnverifiedAfter whereHelperint
	WarnUnverifiedAfter whereHelperint
	WarnMessage         whereHelperstring
	LogChannel          whereHelperint64
	DMMessage           whereHelperstring
}{
	GuildID:             whereHelperint64{/* contains filtered or unexported fields */},
	Enabled:             whereHelperbool{/* contains filtered or unexported fields */},
	VerifiedRole:        whereHelperint64{/* contains filtered or unexported fields */},
	PageContent:         whereHelperstring{/* contains filtered or unexported fields */},
	KickUnverifiedAfter: whereHelperint{/* contains filtered or unexported fields */},
	WarnUnverifiedAfter: whereHelperint{/* contains filtered or unexported fields */},
	WarnMessage:         whereHelperstring{/* contains filtered or unexported fields */},
	LogChannel:          whereHelperint64{/* contains filtered or unexported fields */},
	DMMessage:           whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var VerificationSessionColumns = struct {
	Token     string
	UserID    string
	GuildID   string
	CreatedAt string
	SolvedAt  string
	ExpiredAt string
}{
	Token:     "token",
	UserID:    "user_id",
	GuildID:   "guild_id",
	CreatedAt: "created_at",
	SolvedAt:  "solved_at",
	ExpiredAt: "expired_at",
}
View Source
var VerificationSessionRels = struct {
}{}

VerificationSessionRels is where relationship names are stored.

View Source
var VerificationSessionWhere = struct {
	Token     whereHelperstring
	UserID    whereHelperint64
	GuildID   whereHelperint64
	CreatedAt whereHelpertime_Time
	SolvedAt  whereHelpernull_Time
	ExpiredAt whereHelpernull_Time
}{
	Token:     whereHelperstring{/* contains filtered or unexported fields */},
	UserID:    whereHelperint64{/* contains filtered or unexported fields */},
	GuildID:   whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	SolvedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
	ExpiredAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var VerifiedUserColumns = struct {
	GuildID    string
	UserID     string
	VerifiedAt string
	IP         string
}{
	GuildID:    "guild_id",
	UserID:     "user_id",
	VerifiedAt: "verified_at",
	IP:         "ip",
}
View Source
var VerifiedUserRels = struct {
}{}

VerifiedUserRels is where relationship names are stored.

View Source
var VerifiedUserWhere = struct {
	GuildID    whereHelperint64
	UserID     whereHelperint64
	VerifiedAt whereHelpertime_Time
	IP         whereHelperstring
}{
	GuildID:    whereHelperint64{/* contains filtered or unexported fields */},
	UserID:     whereHelperint64{/* contains filtered or unexported fields */},
	VerifiedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	IP:         whereHelperstring{/* contains filtered or unexported fields */},
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func VerificationConfigExists

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

VerificationConfigExists checks if the VerificationConfig row exists.

func VerificationConfigExistsG

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

VerificationConfigExistsG checks if the VerificationConfig row exists.

func VerificationConfigs

func VerificationConfigs(mods ...qm.QueryMod) verificationConfigQuery

VerificationConfigs retrieves all the records using an executor.

func VerificationSessionExists

func VerificationSessionExists(ctx context.Context, exec boil.ContextExecutor, token string) (bool, error)

VerificationSessionExists checks if the VerificationSession row exists.

func VerificationSessionExistsG

func VerificationSessionExistsG(ctx context.Context, token string) (bool, error)

VerificationSessionExistsG checks if the VerificationSession row exists.

func VerificationSessions

func VerificationSessions(mods ...qm.QueryMod) verificationSessionQuery

VerificationSessions retrieves all the records using an executor.

func VerifiedUserExists added in v1.19.11

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

VerifiedUserExists checks if the VerifiedUser row exists.

func VerifiedUserExistsG added in v1.19.11

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

VerifiedUserExistsG checks if the VerifiedUser row exists.

func VerifiedUsers added in v1.19.11

func VerifiedUsers(mods ...qm.QueryMod) verifiedUserQuery

VerifiedUsers 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 VerificationConfig

type VerificationConfig struct {
	GuildID             int64  `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	Enabled             bool   `boil:"enabled" json:"enabled" toml:"enabled" yaml:"enabled"`
	VerifiedRole        int64  `boil:"verified_role" json:"verified_role" toml:"verified_role" yaml:"verified_role"`
	PageContent         string `boil:"page_content" json:"page_content" toml:"page_content" yaml:"page_content"`
	KickUnverifiedAfter int    `boil:"kick_unverified_after" json:"kick_unverified_after" toml:"kick_unverified_after" yaml:"kick_unverified_after"`
	WarnUnverifiedAfter int    `boil:"warn_unverified_after" json:"warn_unverified_after" toml:"warn_unverified_after" yaml:"warn_unverified_after"`
	WarnMessage         string `boil:"warn_message" json:"warn_message" toml:"warn_message" yaml:"warn_message"`
	LogChannel          int64  `boil:"log_channel" json:"log_channel" toml:"log_channel" yaml:"log_channel"`
	DMMessage           string `boil:"dm_message" json:"dm_message" toml:"dm_message" yaml:"dm_message"`

	R *verificationConfigR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L verificationConfigL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

VerificationConfig is an object representing the database table.

func FindVerificationConfig

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

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

func FindVerificationConfigG

func FindVerificationConfigG(ctx context.Context, guildID int64, selectCols ...string) (*VerificationConfig, error)

FindVerificationConfigG retrieves a single record by ID.

func (*VerificationConfig) Delete

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

func (*VerificationConfig) DeleteG

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

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

func (*VerificationConfig) Insert

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

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

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

func (*VerificationConfig) Reload

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

func (*VerificationConfig) ReloadG

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

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

func (*VerificationConfig) Update

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

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

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

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

func (*VerificationConfig) Upsert

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

func (o *VerificationConfig) 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 VerificationConfigSlice

type VerificationConfigSlice []*VerificationConfig

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

func (VerificationConfigSlice) DeleteAll

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

func (VerificationConfigSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*VerificationConfigSlice) ReloadAll

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

func (*VerificationConfigSlice) ReloadAllG

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

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

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

func (VerificationConfigSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type VerificationSession

type VerificationSession struct {
	Token     string    `boil:"token" json:"token" toml:"token" yaml:"token"`
	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"`
	SolvedAt  null.Time `boil:"solved_at" json:"solved_at,omitempty" toml:"solved_at" yaml:"solved_at,omitempty"`
	ExpiredAt null.Time `boil:"expired_at" json:"expired_at,omitempty" toml:"expired_at" yaml:"expired_at,omitempty"`

	R *verificationSessionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L verificationSessionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

VerificationSession is an object representing the database table.

func FindVerificationSession

func FindVerificationSession(ctx context.Context, exec boil.ContextExecutor, token string, selectCols ...string) (*VerificationSession, error)

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

func FindVerificationSessionG

func FindVerificationSessionG(ctx context.Context, token string, selectCols ...string) (*VerificationSession, error)

FindVerificationSessionG retrieves a single record by ID.

func (*VerificationSession) Delete

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

func (*VerificationSession) DeleteG

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

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

func (*VerificationSession) Insert

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

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

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

func (*VerificationSession) Reload

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

func (*VerificationSession) ReloadG

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

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

func (*VerificationSession) Update

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

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

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

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

func (*VerificationSession) Upsert

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

func (o *VerificationSession) 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 VerificationSessionSlice

type VerificationSessionSlice []*VerificationSession

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

func (VerificationSessionSlice) DeleteAll

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

func (VerificationSessionSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*VerificationSessionSlice) ReloadAll

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

func (*VerificationSessionSlice) ReloadAllG

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

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

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

func (VerificationSessionSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type VerifiedUser added in v1.19.11

type VerifiedUser struct {
	GuildID    int64     `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	UserID     int64     `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	VerifiedAt time.Time `boil:"verified_at" json:"verified_at" toml:"verified_at" yaml:"verified_at"`
	IP         string    `boil:"ip" json:"ip" toml:"ip" yaml:"ip"`

	R *verifiedUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L verifiedUserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

VerifiedUser is an object representing the database table.

func FindVerifiedUser added in v1.19.11

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

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

func FindVerifiedUserG added in v1.19.11

func FindVerifiedUserG(ctx context.Context, guildID int64, userID int64, selectCols ...string) (*VerifiedUser, error)

FindVerifiedUserG retrieves a single record by ID.

func (*VerifiedUser) Delete added in v1.19.11

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

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

func (*VerifiedUser) DeleteG added in v1.19.11

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

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

func (*VerifiedUser) Insert added in v1.19.11

func (o *VerifiedUser) 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 (*VerifiedUser) InsertG added in v1.19.11

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

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

func (*VerifiedUser) Reload added in v1.19.11

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

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

func (*VerifiedUser) ReloadG added in v1.19.11

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

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

func (*VerifiedUser) Update added in v1.19.11

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

Update uses an executor to update the VerifiedUser. 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 (*VerifiedUser) UpdateG added in v1.19.11

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

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

func (*VerifiedUser) Upsert added in v1.19.11

func (o *VerifiedUser) 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 (*VerifiedUser) UpsertG added in v1.19.11

func (o *VerifiedUser) 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 VerifiedUserSlice added in v1.19.11

type VerifiedUserSlice []*VerifiedUser

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

func (VerifiedUserSlice) DeleteAll added in v1.19.11

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

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

func (VerifiedUserSlice) DeleteAllG added in v1.19.11

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

DeleteAllG deletes all rows in the slice.

func (*VerifiedUserSlice) ReloadAll added in v1.19.11

func (o *VerifiedUserSlice) 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 (*VerifiedUserSlice) ReloadAllG added in v1.19.11

func (o *VerifiedUserSlice) 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 (VerifiedUserSlice) UpdateAll added in v1.19.11

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

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

func (VerifiedUserSlice) UpdateAllG added in v1.19.11

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