models

package
v0.0.0-...-3d4fb19 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 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 GuildColumns = struct {
	ID        string
	GuildID   string
	DoMafia   string
	DoJarvis  string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	GuildID:   "guild_id",
	DoMafia:   "do_mafia",
	DoJarvis:  "do_jarvis",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var GuildRels = struct {
}{}

GuildRels is where relationship names are stored.

View Source
var GuildTableColumns = struct {
	ID        string
	GuildID   string
	DoMafia   string
	DoJarvis  string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "guilds.id",
	GuildID:   "guilds.guild_id",
	DoMafia:   "guilds.do_mafia",
	DoJarvis:  "guilds.do_jarvis",
	CreatedAt: "guilds.created_at",
	UpdatedAt: "guilds.updated_at",
}
View Source
var GuildWhere = struct {
	ID        whereHelperint64
	GuildID   whereHelperstring
	DoMafia   whereHelperbool
	DoJarvis  whereHelperbool
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	GuildID:   whereHelperstring{/* contains filtered or unexported fields */},
	DoMafia:   whereHelperbool{/* contains filtered or unexported fields */},
	DoJarvis:  whereHelperbool{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var PronounColumns = struct {
	ID        string
	RoleID    string
	GuildID   string
	Pronoun   string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	RoleID:    "role_id",
	GuildID:   "guild_id",
	Pronoun:   "pronoun",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var PronounRels = struct {
}{}

PronounRels is where relationship names are stored.

View Source
var PronounTableColumns = struct {
	ID        string
	RoleID    string
	GuildID   string
	Pronoun   string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "pronouns.id",
	RoleID:    "pronouns.role_id",
	GuildID:   "pronouns.guild_id",
	Pronoun:   "pronouns.pronoun",
	CreatedAt: "pronouns.created_at",
	UpdatedAt: "pronouns.updated_at",
}
View Source
var PronounWhere = struct {
	ID        whereHelperint64
	RoleID    whereHelperstring
	GuildID   whereHelperstring
	Pronoun   whereHelperstring
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	RoleID:    whereHelperstring{/* contains filtered or unexported fields */},
	GuildID:   whereHelperstring{/* contains filtered or unexported fields */},
	Pronoun:   whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Guilds   string
	Pronouns string
}{
	Guilds:   "guilds",
	Pronouns: "pronouns",
}

Functions

func GuildExists

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

GuildExists checks if the Guild row exists.

func Guilds

func Guilds(mods ...qm.QueryMod) guildQuery

Guilds 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

func PronounExists

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

PronounExists checks if the Pronoun row exists.

func Pronouns

func Pronouns(mods ...qm.QueryMod) pronounQuery

Pronouns retrieves all the records using an executor.

Types

type Guild

type Guild struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	GuildID   string    `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	DoMafia   bool      `boil:"do_mafia" json:"do_mafia" toml:"do_mafia" yaml:"do_mafia"`
	DoJarvis  bool      `boil:"do_jarvis" json:"do_jarvis" toml:"do_jarvis" yaml:"do_jarvis"`
	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"`

	R *guildR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L guildL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Guild is an object representing the database table.

func FindGuild

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

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

func (*Guild) Delete

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

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

func (*Guild) Insert

func (o *Guild) 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 (*Guild) Reload

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

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

func (*Guild) Update

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

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

func (o *Guild) 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.

type GuildSlice

type GuildSlice []*Guild

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

func (GuildSlice) DeleteAll

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

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

func (*GuildSlice) ReloadAll

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

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

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

type M

type M map[string]interface{}

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

type Pronoun

type Pronoun struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	RoleID    string    `boil:"role_id" json:"role_id" toml:"role_id" yaml:"role_id"`
	GuildID   string    `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	Pronoun   string    `boil:"pronoun" json:"pronoun" toml:"pronoun" yaml:"pronoun"`
	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"`

	R *pronounR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L pronounL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Pronoun is an object representing the database table.

func FindPronoun

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

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

func (*Pronoun) Delete

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

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

func (*Pronoun) Insert

func (o *Pronoun) 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 (*Pronoun) Reload

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

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

func (*Pronoun) Update

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

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

func (o *Pronoun) 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.

type PronounSlice

type PronounSlice []*Pronoun

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

func (PronounSlice) DeleteAll

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

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

func (*PronounSlice) ReloadAll

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

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

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

Jump to

Keyboard shortcuts

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