models

package
v2.41.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 17 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 ReminderColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
	UserID    string
	ChannelID string
	GuildID   string
	Message   string
	When      string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
	UserID:    "user_id",
	ChannelID: "channel_id",
	GuildID:   "guild_id",
	Message:   "message",
	When:      "when",
}
View Source
var ReminderRels = struct {
}{}

ReminderRels is where relationship names are stored.

View Source
var ReminderTableColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
	UserID    string
	ChannelID string
	GuildID   string
	Message   string
	When      string
}{
	ID:        "reminders.id",
	CreatedAt: "reminders.created_at",
	UpdatedAt: "reminders.updated_at",
	DeletedAt: "reminders.deleted_at",
	UserID:    "reminders.user_id",
	ChannelID: "reminders.channel_id",
	GuildID:   "reminders.guild_id",
	Message:   "reminders.message",
	When:      "reminders.when",
}
View Source
var ReminderWhere = struct {
	ID        whereHelperint
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
	DeletedAt whereHelpernull_Time
	UserID    whereHelperstring
	ChannelID whereHelperstring
	GuildID   whereHelperint64
	Message   whereHelperstring
	When      whereHelperint64
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	DeletedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UserID:    whereHelperstring{/* contains filtered or unexported fields */},
	ChannelID: whereHelperstring{/* contains filtered or unexported fields */},
	GuildID:   whereHelperint64{/* contains filtered or unexported fields */},
	Message:   whereHelperstring{/* contains filtered or unexported fields */},
	When:      whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Reminders string
}{
	Reminders: "reminders",
}
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 ReminderExists

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

ReminderExists checks if the Reminder row exists.

func ReminderExistsG

func ReminderExistsG(ctx context.Context, iD int) (bool, error)

ReminderExistsG checks if the Reminder row exists.

func Reminders

func Reminders(mods ...qm.QueryMod) reminderQuery

Reminders 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 Reminder

type Reminder struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`
	UserID    string    `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	ChannelID string    `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	GuildID   int64     `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	Message   string    `boil:"message" json:"message" toml:"message" yaml:"message"`
	When      int64     `boil:"when" json:"when" toml:"when" yaml:"when"`

	R *reminderR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L reminderL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Reminder is an object representing the database table.

func FindReminder

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

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

func FindReminderG

func FindReminderG(ctx context.Context, iD int, selectCols ...string) (*Reminder, error)

FindReminderG retrieves a single record by ID.

func (*Reminder) Delete

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

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

func (*Reminder) DeleteG

func (o *Reminder) DeleteG(ctx context.Context, hardDelete bool) (int64, error)

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

func (*Reminder) Exists

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

Exists checks if the Reminder row exists.

func (*Reminder) Insert

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

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

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

func (*Reminder) Reload

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

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

func (*Reminder) ReloadG

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

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

func (*Reminder) Update

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

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

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

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

func (*Reminder) Upsert

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

func (o *Reminder) 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 ReminderSlice

type ReminderSlice []*Reminder

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

func (ReminderSlice) DeleteAll

func (o ReminderSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor, hardDelete bool) (int64, error)

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

func (ReminderSlice) DeleteAllG

func (o ReminderSlice) DeleteAllG(ctx context.Context, hardDelete bool) (int64, error)

DeleteAllG deletes all rows in the slice.

func (*ReminderSlice) ReloadAll

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

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

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

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

func (ReminderSlice) UpdateAllG

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