models

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 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 NotificationsConfigColumns = struct {
	GuildID            string
	JoinServerChannel  string
	JoinServerMessage  string
	LeaveServerChannel string
	LeaveServerMessage string
}{
	GuildID:            "guild_id",
	JoinServerChannel:  "join_server_channel",
	JoinServerMessage:  "join_server_message",
	LeaveServerChannel: "leave_server_channel",
	LeaveServerMessage: "leave_server_message",
}
View Source
var NotificationsConfigRels = struct {
}{}

NotificationsConfigRels is where relationship names are stored.

View Source
var NotificationsConfigTableColumns = struct {
	GuildID            string
	JoinServerChannel  string
	JoinServerMessage  string
	LeaveServerChannel string
	LeaveServerMessage string
}{
	GuildID:            "notifications_config.guild_id",
	JoinServerChannel:  "notifications_config.join_server_channel",
	JoinServerMessage:  "notifications_config.join_server_message",
	LeaveServerChannel: "notifications_config.leave_server_channel",
	LeaveServerMessage: "notifications_config.leave_server_message",
}
View Source
var NotificationsConfigWhere = struct {
	GuildID            whereHelperstring
	JoinServerChannel  whereHelperstring
	JoinServerMessage  whereHelperstring
	LeaveServerChannel whereHelperstring
	LeaveServerMessage whereHelperstring
}{
	GuildID:            whereHelperstring{/* contains filtered or unexported fields */},
	JoinServerChannel:  whereHelperstring{/* contains filtered or unexported fields */},
	JoinServerMessage:  whereHelperstring{/* contains filtered or unexported fields */},
	LeaveServerChannel: whereHelperstring{/* contains filtered or unexported fields */},
	LeaveServerMessage: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	NotificationsConfig string
}{
	NotificationsConfig: "notifications_config",
}
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 NotificationsConfigExists

func NotificationsConfigExists(ctx context.Context, exec boil.ContextExecutor, guildID string) (bool, error)

NotificationsConfigExists checks if the NotificationsConfig row exists.

func NotificationsConfigExistsG

func NotificationsConfigExistsG(ctx context.Context, guildID string) (bool, error)

NotificationsConfigExistsG checks if the NotificationsConfig row exists.

func NotificationsConfigs

func NotificationsConfigs(mods ...qm.QueryMod) notificationsConfigQuery

NotificationsConfigs retrieves all the records using an executor.

Types

type M

type M map[string]any

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

type NotificationsConfig

type NotificationsConfig struct {
	GuildID            string `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	JoinServerChannel  string `boil:"join_server_channel" json:"join_server_channel" toml:"join_server_channel" yaml:"join_server_channel"`
	JoinServerMessage  string `boil:"join_server_message" json:"join_server_message" toml:"join_server_message" yaml:"join_server_message"`
	LeaveServerChannel string `boil:"leave_server_channel" json:"leave_server_channel" toml:"leave_server_channel" yaml:"leave_server_channel"`
	LeaveServerMessage string `boil:"leave_server_message" json:"leave_server_message" toml:"leave_server_message" yaml:"leave_server_message"`

	R *notificationsConfigR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L notificationsConfigL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

NotificationsConfig is an object representing the database table.

func FindNotificationsConfig

func FindNotificationsConfig(ctx context.Context, exec boil.ContextExecutor, guildID string, selectCols ...string) (*NotificationsConfig, error)

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

func FindNotificationsConfigG

func FindNotificationsConfigG(ctx context.Context, guildID string, selectCols ...string) (*NotificationsConfig, error)

FindNotificationsConfigG retrieves a single record by ID.

func (*NotificationsConfig) Delete

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

func (*NotificationsConfig) DeleteG

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

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

func (*NotificationsConfig) Exists

Exists checks if the NotificationsConfig row exists.

func (*NotificationsConfig) Insert

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

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

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

func (*NotificationsConfig) Reload

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

func (*NotificationsConfig) ReloadG

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

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

func (*NotificationsConfig) Update

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

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

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

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

func (*NotificationsConfig) Upsert

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

func (o *NotificationsConfig) 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 NotificationsConfigSlice

type NotificationsConfigSlice []*NotificationsConfig

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

func (NotificationsConfigSlice) DeleteAll

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

func (NotificationsConfigSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*NotificationsConfigSlice) ReloadAll

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

func (*NotificationsConfigSlice) ReloadAllG

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

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

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

func (NotificationsConfigSlice) UpdateAllG

func (o NotificationsConfigSlice) 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
⌂ 换网址