models

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoreConfigColumns = struct {
	GuildID                 string
	AllowedReadOnlyRoles    string
	AllowedWriteRoles       string
	AllowAllMembersReadOnly string
	AllowNonMembersReadOnly string
}{
	GuildID:                 "guild_id",
	AllowedReadOnlyRoles:    "allowed_read_only_roles",
	AllowedWriteRoles:       "allowed_write_roles",
	AllowAllMembersReadOnly: "allow_all_members_read_only",
	AllowNonMembersReadOnly: "allow_non_members_read_only",
}
View Source
var CoreConfigRels = struct {
}{}

CoreConfigRels is where relationship names are stored.

View Source
var CoreConfigWhere = struct {
	GuildID                 whereHelperint64
	AllowedReadOnlyRoles    whereHelpertypes_Int64Array
	AllowedWriteRoles       whereHelpertypes_Int64Array
	AllowAllMembersReadOnly whereHelperbool
	AllowNonMembersReadOnly whereHelperbool
}{
	GuildID:                 whereHelperint64{/* contains filtered or unexported fields */},
	AllowedReadOnlyRoles:    whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	AllowedWriteRoles:       whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	AllowAllMembersReadOnly: whereHelperbool{/* contains filtered or unexported fields */},
	AllowNonMembersReadOnly: whereHelperbool{/* contains filtered or unexported fields */},
}
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 {
	CoreConfigs string
}{
	CoreConfigs: "core_configs",
}

Functions

func CoreConfigExists

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

CoreConfigExists checks if the CoreConfig row exists.

func CoreConfigExistsG

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

CoreConfigExistsG checks if the CoreConfig row exists.

func CoreConfigs

func CoreConfigs(mods ...qm.QueryMod) coreConfigQuery

CoreConfigs retrieves all the records using an executor.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

Types

type CoreConfig

type CoreConfig struct {
	GuildID                 int64            `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	AllowedReadOnlyRoles    types.Int64Array `` /* 143-byte string literal not displayed */
	AllowedWriteRoles       types.Int64Array `` /* 127-byte string literal not displayed */
	AllowAllMembersReadOnly bool             `` /* 139-byte string literal not displayed */
	AllowNonMembersReadOnly bool             `` /* 139-byte string literal not displayed */

	R *coreConfigR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L coreConfigL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

CoreConfig is an object representing the database table.

func FindCoreConfig

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

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

func FindCoreConfigG

func FindCoreConfigG(ctx context.Context, guildID int64, selectCols ...string) (*CoreConfig, error)

FindCoreConfigG retrieves a single record by ID.

func (*CoreConfig) Delete

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

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

func (*CoreConfig) DeleteG

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

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

func (*CoreConfig) Insert

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

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

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

func (*CoreConfig) Reload

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

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

func (*CoreConfig) ReloadG

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

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

func (*CoreConfig) Update

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

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

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

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

func (*CoreConfig) Upsert

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

func (o *CoreConfig) 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 CoreConfigSlice

type CoreConfigSlice []*CoreConfig

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

func (CoreConfigSlice) DeleteAll

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

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

func (CoreConfigSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*CoreConfigSlice) ReloadAll

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

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

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

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

func (CoreConfigSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type M

type M map[string]interface{}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL