models

package
v1.32.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 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 TableNames = struct {
	TicketConfigs      string
	TicketParticipants string
	Tickets            string
}{
	TicketConfigs:      "ticket_configs",
	TicketParticipants: "ticket_participants",
	Tickets:            "tickets",
}
View Source
var TicketColumns = struct {
	GuildID               string
	LocalID               string
	ChannelID             string
	Title                 string
	CreatedAt             string
	ClosedAt              string
	LogsID                string
	AuthorID              string
	AuthorUsernameDiscrim string
}{
	GuildID:               "guild_id",
	LocalID:               "local_id",
	ChannelID:             "channel_id",
	Title:                 "title",
	CreatedAt:             "created_at",
	ClosedAt:              "closed_at",
	LogsID:                "logs_id",
	AuthorID:              "author_id",
	AuthorUsernameDiscrim: "author_username_discrim",
}
View Source
var TicketConfigColumns = struct {
	GuildID                            string
	Enabled                            string
	TicketOpenMSG                      string
	TicketsChannelCategory             string
	StatusChannel                      string
	TicketsTranscriptsChannel          string
	DownloadAttachments                string
	TicketsUseTXTTranscripts           string
	ModRoles                           string
	AdminRoles                         string
	TicketsTranscriptsChannelAdminOnly string
}{
	GuildID:                            "guild_id",
	Enabled:                            "enabled",
	TicketOpenMSG:                      "ticket_open_msg",
	TicketsChannelCategory:             "tickets_channel_category",
	StatusChannel:                      "status_channel",
	TicketsTranscriptsChannel:          "tickets_transcripts_channel",
	DownloadAttachments:                "download_attachments",
	TicketsUseTXTTranscripts:           "tickets_use_txt_transcripts",
	ModRoles:                           "mod_roles",
	AdminRoles:                         "admin_roles",
	TicketsTranscriptsChannelAdminOnly: "tickets_transcripts_channel_admin_only",
}
View Source
var TicketConfigRels = struct {
}{}

TicketConfigRels is where relationship names are stored.

View Source
var TicketConfigWhere = struct {
	GuildID                            whereHelperint64
	Enabled                            whereHelperbool
	TicketOpenMSG                      whereHelperstring
	TicketsChannelCategory             whereHelperint64
	StatusChannel                      whereHelperint64
	TicketsTranscriptsChannel          whereHelperint64
	DownloadAttachments                whereHelperbool
	TicketsUseTXTTranscripts           whereHelperbool
	ModRoles                           whereHelpertypes_Int64Array
	AdminRoles                         whereHelpertypes_Int64Array
	TicketsTranscriptsChannelAdminOnly whereHelperint64
}{
	GuildID:                            whereHelperint64{/* contains filtered or unexported fields */},
	Enabled:                            whereHelperbool{/* contains filtered or unexported fields */},
	TicketOpenMSG:                      whereHelperstring{/* contains filtered or unexported fields */},
	TicketsChannelCategory:             whereHelperint64{/* contains filtered or unexported fields */},
	StatusChannel:                      whereHelperint64{/* contains filtered or unexported fields */},
	TicketsTranscriptsChannel:          whereHelperint64{/* contains filtered or unexported fields */},
	DownloadAttachments:                whereHelperbool{/* contains filtered or unexported fields */},
	TicketsUseTXTTranscripts:           whereHelperbool{/* contains filtered or unexported fields */},
	ModRoles:                           whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	AdminRoles:                         whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	TicketsTranscriptsChannelAdminOnly: whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var TicketParticipantColumns = struct {
	TicketGuildID string
	TicketLocalID string
	UserID        string
	Username      string
	Discrim       string
	IsStaff       string
}{
	TicketGuildID: "ticket_guild_id",
	TicketLocalID: "ticket_local_id",
	UserID:        "user_id",
	Username:      "username",
	Discrim:       "discrim",
	IsStaff:       "is_staff",
}
View Source
var TicketParticipantRels = struct {
}{}

TicketParticipantRels is where relationship names are stored.

View Source
var TicketParticipantWhere = struct {
	TicketGuildID whereHelperint64
	TicketLocalID whereHelperint64
	UserID        whereHelperint64
	Username      whereHelperstring
	Discrim       whereHelperstring
	IsStaff       whereHelperbool
}{
	TicketGuildID: whereHelperint64{/* contains filtered or unexported fields */},
	TicketLocalID: whereHelperint64{/* contains filtered or unexported fields */},
	UserID:        whereHelperint64{/* contains filtered or unexported fields */},
	Username:      whereHelperstring{/* contains filtered or unexported fields */},
	Discrim:       whereHelperstring{/* contains filtered or unexported fields */},
	IsStaff:       whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var TicketRels = struct {
}{}

TicketRels is where relationship names are stored.

View Source
var TicketWhere = struct {
	GuildID               whereHelperint64
	LocalID               whereHelperint64
	ChannelID             whereHelperint64
	Title                 whereHelperstring
	CreatedAt             whereHelpertime_Time
	ClosedAt              whereHelpernull_Time
	LogsID                whereHelperint64
	AuthorID              whereHelperint64
	AuthorUsernameDiscrim whereHelperstring
}{
	GuildID:               whereHelperint64{/* contains filtered or unexported fields */},
	LocalID:               whereHelperint64{/* contains filtered or unexported fields */},
	ChannelID:             whereHelperint64{/* contains filtered or unexported fields */},
	Title:                 whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:             whereHelpertime_Time{/* contains filtered or unexported fields */},
	ClosedAt:              whereHelpernull_Time{/* contains filtered or unexported fields */},
	LogsID:                whereHelperint64{/* contains filtered or unexported fields */},
	AuthorID:              whereHelperint64{/* contains filtered or unexported fields */},
	AuthorUsernameDiscrim: whereHelperstring{/* contains filtered or unexported fields */},
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func TicketConfigExists

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

TicketConfigExists checks if the TicketConfig row exists.

func TicketConfigExistsG

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

TicketConfigExistsG checks if the TicketConfig row exists.

func TicketConfigs

func TicketConfigs(mods ...qm.QueryMod) ticketConfigQuery

TicketConfigs retrieves all the records using an executor.

func TicketExists

func TicketExists(ctx context.Context, exec boil.ContextExecutor, guildID int64, localID int64) (bool, error)

TicketExists checks if the Ticket row exists.

func TicketExistsG

func TicketExistsG(ctx context.Context, guildID int64, localID int64) (bool, error)

TicketExistsG checks if the Ticket row exists.

func TicketParticipantExists

func TicketParticipantExists(ctx context.Context, exec boil.ContextExecutor, ticketGuildID int64, ticketLocalID int64, userID int64) (bool, error)

TicketParticipantExists checks if the TicketParticipant row exists.

func TicketParticipantExistsG

func TicketParticipantExistsG(ctx context.Context, ticketGuildID int64, ticketLocalID int64, userID int64) (bool, error)

TicketParticipantExistsG checks if the TicketParticipant row exists.

func TicketParticipants

func TicketParticipants(mods ...qm.QueryMod) ticketParticipantQuery

TicketParticipants retrieves all the records using an executor.

func Tickets

func Tickets(mods ...qm.QueryMod) ticketQuery

Tickets 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 Ticket

type Ticket struct {
	GuildID               int64     `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	LocalID               int64     `boil:"local_id" json:"local_id" toml:"local_id" yaml:"local_id"`
	ChannelID             int64     `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	Title                 string    `boil:"title" json:"title" toml:"title" yaml:"title"`
	CreatedAt             time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	ClosedAt              null.Time `boil:"closed_at" json:"closed_at,omitempty" toml:"closed_at" yaml:"closed_at,omitempty"`
	LogsID                int64     `boil:"logs_id" json:"logs_id" toml:"logs_id" yaml:"logs_id"`
	AuthorID              int64     `boil:"author_id" json:"author_id" toml:"author_id" yaml:"author_id"`
	AuthorUsernameDiscrim string    `boil:"author_username_discrim" json:"author_username_discrim" toml:"author_username_discrim" yaml:"author_username_discrim"`

	R *ticketR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L ticketL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Ticket is an object representing the database table.

func FindTicket

func FindTicket(ctx context.Context, exec boil.ContextExecutor, guildID int64, localID int64, selectCols ...string) (*Ticket, error)

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

func FindTicketG

func FindTicketG(ctx context.Context, guildID int64, localID int64, selectCols ...string) (*Ticket, error)

FindTicketG retrieves a single record by ID.

func (*Ticket) Delete

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

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

func (*Ticket) DeleteG

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

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

func (*Ticket) Insert

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

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

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

func (*Ticket) Reload

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

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

func (*Ticket) ReloadG

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

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

func (*Ticket) Update

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

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

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

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

func (*Ticket) Upsert

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

func (o *Ticket) 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 TicketConfig

type TicketConfig struct {
	GuildID                            int64            `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	Enabled                            bool             `boil:"enabled" json:"enabled" toml:"enabled" yaml:"enabled"`
	TicketOpenMSG                      string           `boil:"ticket_open_msg" json:"ticket_open_msg" toml:"ticket_open_msg" yaml:"ticket_open_msg"`
	TicketsChannelCategory             int64            `` /* 127-byte string literal not displayed */
	StatusChannel                      int64            `boil:"status_channel" json:"status_channel" toml:"status_channel" yaml:"status_channel"`
	TicketsTranscriptsChannel          int64            `` /* 139-byte string literal not displayed */
	DownloadAttachments                bool             `boil:"download_attachments" json:"download_attachments" toml:"download_attachments" yaml:"download_attachments"`
	TicketsUseTXTTranscripts           bool             `` /* 139-byte string literal not displayed */
	ModRoles                           types.Int64Array `boil:"mod_roles" json:"mod_roles,omitempty" toml:"mod_roles" yaml:"mod_roles,omitempty"`
	AdminRoles                         types.Int64Array `boil:"admin_roles" json:"admin_roles,omitempty" toml:"admin_roles" yaml:"admin_roles,omitempty"`
	TicketsTranscriptsChannelAdminOnly int64            `` /* 183-byte string literal not displayed */

	R *ticketConfigR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L ticketConfigL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TicketConfig is an object representing the database table.

func FindTicketConfig

func FindTicketConfig(ctx context.Context, exec boil.ContextExecutor, guildID int64, selectCols ...string) (*TicketConfig, error)

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

func FindTicketConfigG

func FindTicketConfigG(ctx context.Context, guildID int64, selectCols ...string) (*TicketConfig, error)

FindTicketConfigG retrieves a single record by ID.

func (*TicketConfig) Delete

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

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

func (*TicketConfig) DeleteG

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

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

func (*TicketConfig) Insert

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

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

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

func (*TicketConfig) Reload

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

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

func (*TicketConfig) ReloadG

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

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

func (*TicketConfig) Update

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

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

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

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

func (*TicketConfig) Upsert

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

func (o *TicketConfig) 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 TicketConfigSlice

type TicketConfigSlice []*TicketConfig

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

func (TicketConfigSlice) DeleteAll

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

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

func (TicketConfigSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*TicketConfigSlice) ReloadAll

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

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

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

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

func (TicketConfigSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type TicketParticipant

type TicketParticipant struct {
	TicketGuildID int64  `boil:"ticket_guild_id" json:"ticket_guild_id" toml:"ticket_guild_id" yaml:"ticket_guild_id"`
	TicketLocalID int64  `boil:"ticket_local_id" json:"ticket_local_id" toml:"ticket_local_id" yaml:"ticket_local_id"`
	UserID        int64  `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	Username      string `boil:"username" json:"username" toml:"username" yaml:"username"`
	Discrim       string `boil:"discrim" json:"discrim" toml:"discrim" yaml:"discrim"`
	IsStaff       bool   `boil:"is_staff" json:"is_staff" toml:"is_staff" yaml:"is_staff"`

	R *ticketParticipantR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L ticketParticipantL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TicketParticipant is an object representing the database table.

func FindTicketParticipant

func FindTicketParticipant(ctx context.Context, exec boil.ContextExecutor, ticketGuildID int64, ticketLocalID int64, userID int64, selectCols ...string) (*TicketParticipant, error)

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

func FindTicketParticipantG

func FindTicketParticipantG(ctx context.Context, ticketGuildID int64, ticketLocalID int64, userID int64, selectCols ...string) (*TicketParticipant, error)

FindTicketParticipantG retrieves a single record by ID.

func (*TicketParticipant) Delete

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

func (*TicketParticipant) DeleteG

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

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

func (*TicketParticipant) Insert

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

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

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

func (*TicketParticipant) Reload

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

func (*TicketParticipant) ReloadG

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

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

func (*TicketParticipant) Update

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

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

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

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

func (*TicketParticipant) Upsert

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

func (o *TicketParticipant) 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 TicketParticipantSlice

type TicketParticipantSlice []*TicketParticipant

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

func (TicketParticipantSlice) DeleteAll

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

func (TicketParticipantSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*TicketParticipantSlice) ReloadAll

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

func (*TicketParticipantSlice) ReloadAllG

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

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

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

func (TicketParticipantSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type TicketSlice

type TicketSlice []*Ticket

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

func (TicketSlice) DeleteAll

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

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

func (TicketSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*TicketSlice) ReloadAll

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

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

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

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

func (TicketSlice) UpdateAllG

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