models

package
v1.19.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 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 SoundboardSoundColumns = struct {
	ID               string
	CreatedAt        string
	UpdatedAt        string
	GuildID          string
	RequiredRole     string
	Name             string
	Status           string
	RequiredRoles    string
	BlacklistedRoles string
}{
	ID:               "id",
	CreatedAt:        "created_at",
	UpdatedAt:        "updated_at",
	GuildID:          "guild_id",
	RequiredRole:     "required_role",
	Name:             "name",
	Status:           "status",
	RequiredRoles:    "required_roles",
	BlacklistedRoles: "blacklisted_roles",
}
View Source
var SoundboardSoundRels = struct {
}{}

SoundboardSoundRels is where relationship names are stored.

View Source
var SoundboardSoundWhere = struct {
	ID               whereHelperint
	CreatedAt        whereHelpertime_Time
	UpdatedAt        whereHelpertime_Time
	GuildID          whereHelperint64
	RequiredRole     whereHelperstring
	Name             whereHelperstring
	Status           whereHelperint
	RequiredRoles    whereHelpertypes_Int64Array
	BlacklistedRoles whereHelpertypes_Int64Array
}{
	ID:               whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:        whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:        whereHelpertime_Time{/* contains filtered or unexported fields */},
	GuildID:          whereHelperint64{/* contains filtered or unexported fields */},
	RequiredRole:     whereHelperstring{/* contains filtered or unexported fields */},
	Name:             whereHelperstring{/* contains filtered or unexported fields */},
	Status:           whereHelperint{/* contains filtered or unexported fields */},
	RequiredRoles:    whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	BlacklistedRoles: whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	SoundboardSounds string
}{
	SoundboardSounds: "soundboard_sounds",
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func SoundboardSoundExists

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

SoundboardSoundExists checks if the SoundboardSound row exists.

func SoundboardSoundExistsG

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

SoundboardSoundExistsG checks if the SoundboardSound row exists.

func SoundboardSounds

func SoundboardSounds(mods ...qm.QueryMod) soundboardSoundQuery

SoundboardSounds 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 SoundboardSound

type SoundboardSound 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"`
	GuildID          int64            `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	RequiredRole     string           `boil:"required_role" json:"required_role" toml:"required_role" yaml:"required_role"`
	Name             string           `boil:"name" json:"name" toml:"name" yaml:"name"`
	Status           int              `boil:"status" json:"status" toml:"status" yaml:"status"`
	RequiredRoles    types.Int64Array `boil:"required_roles" json:"required_roles,omitempty" toml:"required_roles" yaml:"required_roles,omitempty"`
	BlacklistedRoles types.Int64Array `boil:"blacklisted_roles" json:"blacklisted_roles,omitempty" toml:"blacklisted_roles" yaml:"blacklisted_roles,omitempty"`

	R *soundboardSoundR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L soundboardSoundL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

SoundboardSound is an object representing the database table.

func FindSoundboardSound

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

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

func FindSoundboardSoundG

func FindSoundboardSoundG(ctx context.Context, iD int, selectCols ...string) (*SoundboardSound, error)

FindSoundboardSoundG retrieves a single record by ID.

func (*SoundboardSound) Delete

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

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

func (*SoundboardSound) DeleteG

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

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

func (*SoundboardSound) Insert

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

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

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

func (*SoundboardSound) Reload

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

func (*SoundboardSound) ReloadG

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

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

func (*SoundboardSound) Update

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

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

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

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

func (*SoundboardSound) Upsert

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

func (o *SoundboardSound) 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 SoundboardSoundSlice

type SoundboardSoundSlice []*SoundboardSound

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

func (SoundboardSoundSlice) DeleteAll

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

func (SoundboardSoundSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*SoundboardSoundSlice) ReloadAll

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

func (*SoundboardSoundSlice) ReloadAllG

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

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

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

func (SoundboardSoundSlice) UpdateAllG

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