models

package
v2.94.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 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 {
	TriviaUsers string
}{
	TriviaUsers: "trivia_users",
}
View Source
var TriviaUserColumns = struct {
	UserID           string
	GuildID          string
	Score            string
	CorrectAnswers   string
	IncorrectAnswers string
	CurrentStreak    string
	MaxStreak        string
	LastPlayed       string
}{
	UserID:           "user_id",
	GuildID:          "guild_id",
	Score:            "score",
	CorrectAnswers:   "correct_answers",
	IncorrectAnswers: "incorrect_answers",
	CurrentStreak:    "current_streak",
	MaxStreak:        "max_streak",
	LastPlayed:       "last_played",
}
View Source
var TriviaUserRels = struct {
}{}

TriviaUserRels is where relationship names are stored.

View Source
var TriviaUserTableColumns = struct {
	UserID           string
	GuildID          string
	Score            string
	CorrectAnswers   string
	IncorrectAnswers string
	CurrentStreak    string
	MaxStreak        string
	LastPlayed       string
}{
	UserID:           "trivia_users.user_id",
	GuildID:          "trivia_users.guild_id",
	Score:            "trivia_users.score",
	CorrectAnswers:   "trivia_users.correct_answers",
	IncorrectAnswers: "trivia_users.incorrect_answers",
	CurrentStreak:    "trivia_users.current_streak",
	MaxStreak:        "trivia_users.max_streak",
	LastPlayed:       "trivia_users.last_played",
}
View Source
var TriviaUserWhere = struct {
	UserID           whereHelperint64
	GuildID          whereHelperint64
	Score            whereHelperint
	CorrectAnswers   whereHelperint
	IncorrectAnswers whereHelperint
	CurrentStreak    whereHelperint
	MaxStreak        whereHelperint
	LastPlayed       whereHelpertime_Time
}{
	UserID:           whereHelperint64{/* contains filtered or unexported fields */},
	GuildID:          whereHelperint64{/* contains filtered or unexported fields */},
	Score:            whereHelperint{/* contains filtered or unexported fields */},
	CorrectAnswers:   whereHelperint{/* contains filtered or unexported fields */},
	IncorrectAnswers: whereHelperint{/* contains filtered or unexported fields */},
	CurrentStreak:    whereHelperint{/* contains filtered or unexported fields */},
	MaxStreak:        whereHelperint{/* contains filtered or unexported fields */},
	LastPlayed:       whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func TriviaUserExists

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

TriviaUserExists checks if the TriviaUser row exists.

func TriviaUserExistsG

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

TriviaUserExistsG checks if the TriviaUser row exists.

func TriviaUsers

func TriviaUsers(mods ...qm.QueryMod) triviaUserQuery

TriviaUsers 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 TriviaUser

type TriviaUser 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"`
	Score            int       `boil:"score" json:"score" toml:"score" yaml:"score"`
	CorrectAnswers   int       `boil:"correct_answers" json:"correct_answers" toml:"correct_answers" yaml:"correct_answers"`
	IncorrectAnswers int       `boil:"incorrect_answers" json:"incorrect_answers" toml:"incorrect_answers" yaml:"incorrect_answers"`
	CurrentStreak    int       `boil:"current_streak" json:"current_streak" toml:"current_streak" yaml:"current_streak"`
	MaxStreak        int       `boil:"max_streak" json:"max_streak" toml:"max_streak" yaml:"max_streak"`
	LastPlayed       time.Time `boil:"last_played" json:"last_played" toml:"last_played" yaml:"last_played"`

	R *triviaUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L triviaUserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TriviaUser is an object representing the database table.

func FindTriviaUser

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

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

func FindTriviaUserG

func FindTriviaUserG(ctx context.Context, guildID int64, userID int64, selectCols ...string) (*TriviaUser, error)

FindTriviaUserG retrieves a single record by ID.

func (*TriviaUser) Delete

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

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

func (*TriviaUser) DeleteG

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

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

func (*TriviaUser) Exists

func (o *TriviaUser) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the TriviaUser row exists.

func (*TriviaUser) Insert

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

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

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

func (*TriviaUser) Reload

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

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

func (*TriviaUser) ReloadG

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

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

func (*TriviaUser) Update

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

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

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

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

func (*TriviaUser) Upsert

func (o *TriviaUser) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) 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 (*TriviaUser) UpsertG

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

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

type TriviaUserSlice

type TriviaUserSlice []*TriviaUser

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

func (TriviaUserSlice) DeleteAll

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

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

func (TriviaUserSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*TriviaUserSlice) ReloadAll

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

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

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

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

func (TriviaUserSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type UpsertOptionFunc

type UpsertOptionFunc func(o *UpsertOptions)

func UpsertConflictTarget

func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc

func UpsertUpdateSet

func UpsertUpdateSet(updateSet string) UpsertOptionFunc

type UpsertOptions

type UpsertOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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