models

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 15 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 PremiumCodeColumns = struct {
	ID        string
	Code      string
	Message   string
	CreatedAt string
	UsedAt    string
	SlotID    string
	UserID    string
	GuildID   string
	Permanent string
	Duration  string
}{
	ID:        "id",
	Code:      "code",
	Message:   "message",
	CreatedAt: "created_at",
	UsedAt:    "used_at",
	SlotID:    "slot_id",
	UserID:    "user_id",
	GuildID:   "guild_id",
	Permanent: "permanent",
	Duration:  "duration",
}
View Source
var PremiumCodeRels = struct {
	Slot string
}{
	Slot: "Slot",
}

PremiumCodeRels is where relationship names are stored.

View Source
var PremiumSlotColumns = struct {
	ID                string
	CreatedAt         string
	AttachedAt        string
	UserID            string
	GuildID           string
	Title             string
	Message           string
	Source            string
	SourceID          string
	FullDuration      string
	Permanent         string
	DurationRemaining string
}{
	ID:                "id",
	CreatedAt:         "created_at",
	AttachedAt:        "attached_at",
	UserID:            "user_id",
	GuildID:           "guild_id",
	Title:             "title",
	Message:           "message",
	Source:            "source",
	SourceID:          "source_id",
	FullDuration:      "full_duration",
	Permanent:         "permanent",
	DurationRemaining: "duration_remaining",
}
View Source
var PremiumSlotRels = struct {
	SlotPremiumCodes string
}{
	SlotPremiumCodes: "SlotPremiumCodes",
}

PremiumSlotRels is where relationship names are stored.

View Source
var TableNames = struct {
	PremiumCodes string
	PremiumSlots string
}{
	PremiumCodes: "premium_codes",
	PremiumSlots: "premium_slots",
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func PremiumCodeExists

func PremiumCodeExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PremiumCodeExists checks if the PremiumCode row exists.

func PremiumCodeExistsG

func PremiumCodeExistsG(ctx context.Context, iD int64) (bool, error)

PremiumCodeExistsG checks if the PremiumCode row exists.

func PremiumCodes

func PremiumCodes(mods ...qm.QueryMod) premiumCodeQuery

PremiumCodes retrieves all the records using an executor.

func PremiumSlotExists

func PremiumSlotExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PremiumSlotExists checks if the PremiumSlot row exists.

func PremiumSlotExistsG

func PremiumSlotExistsG(ctx context.Context, iD int64) (bool, error)

PremiumSlotExistsG checks if the PremiumSlot row exists.

func PremiumSlots

func PremiumSlots(mods ...qm.QueryMod) premiumSlotQuery

PremiumSlots 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 PremiumCode

type PremiumCode struct {
	ID        int64      `boil:"id" json:"id" toml:"id" yaml:"id"`
	Code      string     `boil:"code" json:"code" toml:"code" yaml:"code"`
	Message   string     `boil:"message" json:"message" toml:"message" yaml:"message"`
	CreatedAt time.Time  `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UsedAt    null.Time  `boil:"used_at" json:"used_at,omitempty" toml:"used_at" yaml:"used_at,omitempty"`
	SlotID    null.Int64 `boil:"slot_id" json:"slot_id,omitempty" toml:"slot_id" yaml:"slot_id,omitempty"`
	UserID    null.Int64 `boil:"user_id" json:"user_id,omitempty" toml:"user_id" yaml:"user_id,omitempty"`
	GuildID   null.Int64 `boil:"guild_id" json:"guild_id,omitempty" toml:"guild_id" yaml:"guild_id,omitempty"`
	Permanent bool       `boil:"permanent" json:"permanent" toml:"permanent" yaml:"permanent"`
	Duration  int64      `boil:"duration" json:"duration" toml:"duration" yaml:"duration"`

	R *premiumCodeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L premiumCodeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

PremiumCode is an object representing the database table.

func FindPremiumCode

func FindPremiumCode(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*PremiumCode, error)

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

func FindPremiumCodeG

func FindPremiumCodeG(ctx context.Context, iD int64, selectCols ...string) (*PremiumCode, error)

FindPremiumCodeG retrieves a single record by ID.

func (*PremiumCode) Delete

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

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

func (*PremiumCode) DeleteG

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

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

func (*PremiumCode) Insert

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

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

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

func (*PremiumCode) Reload

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

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

func (*PremiumCode) ReloadG

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

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

func (*PremiumCode) RemoveSlot

func (o *PremiumCode) RemoveSlot(ctx context.Context, exec boil.ContextExecutor, related *PremiumSlot) error

RemoveSlot relationship. Sets o.R.Slot to nil. Removes o from all passed in related items' relationships struct (Optional).

func (*PremiumCode) RemoveSlotG

func (o *PremiumCode) RemoveSlotG(ctx context.Context, related *PremiumSlot) error

RemoveSlotG relationship. Sets o.R.Slot to nil. Removes o from all passed in related items' relationships struct (Optional). Uses the global database handle.

func (*PremiumCode) SetSlot

func (o *PremiumCode) SetSlot(ctx context.Context, exec boil.ContextExecutor, insert bool, related *PremiumSlot) error

SetSlot of the premiumCode to the related item. Sets o.R.Slot to related. Adds o to related.R.SlotPremiumCodes.

func (*PremiumCode) SetSlotG

func (o *PremiumCode) SetSlotG(ctx context.Context, insert bool, related *PremiumSlot) error

SetSlotG of the premiumCode to the related item. Sets o.R.Slot to related. Adds o to related.R.SlotPremiumCodes. Uses the global database handle.

func (*PremiumCode) Slot

func (o *PremiumCode) Slot(mods ...qm.QueryMod) premiumSlotQuery

Slot pointed to by the foreign key.

func (*PremiumCode) Update

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

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

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

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

func (*PremiumCode) Upsert

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

func (o *PremiumCode) 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 PremiumCodeSlice

type PremiumCodeSlice []*PremiumCode

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

func (PremiumCodeSlice) DeleteAll

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

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

func (PremiumCodeSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*PremiumCodeSlice) ReloadAll

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

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

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

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

func (PremiumCodeSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type PremiumSlot

type PremiumSlot struct {
	ID                int64      `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt         time.Time  `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	AttachedAt        null.Time  `boil:"attached_at" json:"attached_at,omitempty" toml:"attached_at" yaml:"attached_at,omitempty"`
	UserID            int64      `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	GuildID           null.Int64 `boil:"guild_id" json:"guild_id,omitempty" toml:"guild_id" yaml:"guild_id,omitempty"`
	Title             string     `boil:"title" json:"title" toml:"title" yaml:"title"`
	Message           string     `boil:"message" json:"message" toml:"message" yaml:"message"`
	Source            string     `boil:"source" json:"source" toml:"source" yaml:"source"`
	SourceID          int64      `boil:"source_id" json:"source_id" toml:"source_id" yaml:"source_id"`
	FullDuration      int64      `boil:"full_duration" json:"full_duration" toml:"full_duration" yaml:"full_duration"`
	Permanent         bool       `boil:"permanent" json:"permanent" toml:"permanent" yaml:"permanent"`
	DurationRemaining int64      `boil:"duration_remaining" json:"duration_remaining" toml:"duration_remaining" yaml:"duration_remaining"`

	R *premiumSlotR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L premiumSlotL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

PremiumSlot is an object representing the database table.

func FindPremiumSlot

func FindPremiumSlot(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*PremiumSlot, error)

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

func FindPremiumSlotG

func FindPremiumSlotG(ctx context.Context, iD int64, selectCols ...string) (*PremiumSlot, error)

FindPremiumSlotG retrieves a single record by ID.

func (*PremiumSlot) AddSlotPremiumCodes

func (o *PremiumSlot) AddSlotPremiumCodes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PremiumCode) error

AddSlotPremiumCodes adds the given related objects to the existing relationships of the premium_slot, optionally inserting them as new records. Appends related to o.R.SlotPremiumCodes. Sets related.R.Slot appropriately.

func (*PremiumSlot) AddSlotPremiumCodesG

func (o *PremiumSlot) AddSlotPremiumCodesG(ctx context.Context, insert bool, related ...*PremiumCode) error

AddSlotPremiumCodesG adds the given related objects to the existing relationships of the premium_slot, optionally inserting them as new records. Appends related to o.R.SlotPremiumCodes. Sets related.R.Slot appropriately. Uses the global database handle.

func (*PremiumSlot) Delete

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

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

func (*PremiumSlot) DeleteG

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

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

func (*PremiumSlot) Insert

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

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

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

func (*PremiumSlot) Reload

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

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

func (*PremiumSlot) ReloadG

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

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

func (*PremiumSlot) RemoveSlotPremiumCodes

func (o *PremiumSlot) RemoveSlotPremiumCodes(ctx context.Context, exec boil.ContextExecutor, related ...*PremiumCode) error

RemoveSlotPremiumCodes relationships from objects passed in. Removes related items from R.SlotPremiumCodes (uses pointer comparison, removal does not keep order) Sets related.R.Slot.

func (*PremiumSlot) RemoveSlotPremiumCodesG

func (o *PremiumSlot) RemoveSlotPremiumCodesG(ctx context.Context, related ...*PremiumCode) error

RemoveSlotPremiumCodesG relationships from objects passed in. Removes related items from R.SlotPremiumCodes (uses pointer comparison, removal does not keep order) Sets related.R.Slot. Uses the global database handle.

func (*PremiumSlot) SetSlotPremiumCodes

func (o *PremiumSlot) SetSlotPremiumCodes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PremiumCode) error

SetSlotPremiumCodes removes all previously related items of the premium_slot replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Slot's SlotPremiumCodes accordingly. Replaces o.R.SlotPremiumCodes with related. Sets related.R.Slot's SlotPremiumCodes accordingly.

func (*PremiumSlot) SetSlotPremiumCodesG

func (o *PremiumSlot) SetSlotPremiumCodesG(ctx context.Context, insert bool, related ...*PremiumCode) error

SetSlotPremiumCodesG removes all previously related items of the premium_slot replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Slot's SlotPremiumCodes accordingly. Replaces o.R.SlotPremiumCodes with related. Sets related.R.Slot's SlotPremiumCodes accordingly. Uses the global database handle.

func (*PremiumSlot) SlotPremiumCodes

func (o *PremiumSlot) SlotPremiumCodes(mods ...qm.QueryMod) premiumCodeQuery

SlotPremiumCodes retrieves all the premium_code's PremiumCodes with an executor via slot_id column.

func (*PremiumSlot) Update

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

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

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

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

func (*PremiumSlot) Upsert

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

func (o *PremiumSlot) 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 PremiumSlotSlice

type PremiumSlotSlice []*PremiumSlot

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

func (PremiumSlotSlice) DeleteAll

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

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

func (PremiumSlotSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*PremiumSlotSlice) ReloadAll

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

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

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

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

func (PremiumSlotSlice) UpdateAllG

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