models

package
v0.0.0-...-fb67095 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 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 RedditFeedColumns = struct {
	ID              string
	GuildID         string
	ChannelID       string
	Subreddit       string
	FilterNSFW      string
	MinUpvotes      string
	UseEmbeds       string
	Slow            string
	Disabled        string
	SpoilersEnabled string
}{
	ID:              "id",
	GuildID:         "guild_id",
	ChannelID:       "channel_id",
	Subreddit:       "subreddit",
	FilterNSFW:      "filter_nsfw",
	MinUpvotes:      "min_upvotes",
	UseEmbeds:       "use_embeds",
	Slow:            "slow",
	Disabled:        "disabled",
	SpoilersEnabled: "spoilers_enabled",
}
View Source
var RedditFeedRels = struct {
}{}

RedditFeedRels is where relationship names are stored.

View Source
var RedditFeedTableColumns = struct {
	ID              string
	GuildID         string
	ChannelID       string
	Subreddit       string
	FilterNSFW      string
	MinUpvotes      string
	UseEmbeds       string
	Slow            string
	Disabled        string
	SpoilersEnabled string
}{
	ID:              "reddit_feeds.id",
	GuildID:         "reddit_feeds.guild_id",
	ChannelID:       "reddit_feeds.channel_id",
	Subreddit:       "reddit_feeds.subreddit",
	FilterNSFW:      "reddit_feeds.filter_nsfw",
	MinUpvotes:      "reddit_feeds.min_upvotes",
	UseEmbeds:       "reddit_feeds.use_embeds",
	Slow:            "reddit_feeds.slow",
	Disabled:        "reddit_feeds.disabled",
	SpoilersEnabled: "reddit_feeds.spoilers_enabled",
}
View Source
var RedditFeedWhere = struct {
	ID              whereHelperint64
	GuildID         whereHelperint64
	ChannelID       whereHelperint64
	Subreddit       whereHelperstring
	FilterNSFW      whereHelperint
	MinUpvotes      whereHelperint
	UseEmbeds       whereHelperbool
	Slow            whereHelperbool
	Disabled        whereHelperbool
	SpoilersEnabled whereHelperbool
}{
	ID:              whereHelperint64{/* contains filtered or unexported fields */},
	GuildID:         whereHelperint64{/* contains filtered or unexported fields */},
	ChannelID:       whereHelperint64{/* contains filtered or unexported fields */},
	Subreddit:       whereHelperstring{/* contains filtered or unexported fields */},
	FilterNSFW:      whereHelperint{/* contains filtered or unexported fields */},
	MinUpvotes:      whereHelperint{/* contains filtered or unexported fields */},
	UseEmbeds:       whereHelperbool{/* contains filtered or unexported fields */},
	Slow:            whereHelperbool{/* contains filtered or unexported fields */},
	Disabled:        whereHelperbool{/* contains filtered or unexported fields */},
	SpoilersEnabled: whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	RedditFeeds string
}{
	RedditFeeds: "reddit_feeds",
}

Functions

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func RedditFeedExists

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

RedditFeedExists checks if the RedditFeed row exists.

func RedditFeedExistsG

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

RedditFeedExistsG checks if the RedditFeed row exists.

func RedditFeeds

func RedditFeeds(mods ...qm.QueryMod) redditFeedQuery

RedditFeeds 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 RedditFeed

type RedditFeed struct {
	ID              int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	GuildID         int64  `boil:"guild_id" json:"guild_id" toml:"guild_id" yaml:"guild_id"`
	ChannelID       int64  `boil:"channel_id" json:"channel_id" toml:"channel_id" yaml:"channel_id"`
	Subreddit       string `boil:"subreddit" json:"subreddit" toml:"subreddit" yaml:"subreddit"`
	FilterNSFW      int    `boil:"filter_nsfw" json:"filter_nsfw" toml:"filter_nsfw" yaml:"filter_nsfw"`
	MinUpvotes      int    `boil:"min_upvotes" json:"min_upvotes" toml:"min_upvotes" yaml:"min_upvotes"`
	UseEmbeds       bool   `boil:"use_embeds" json:"use_embeds" toml:"use_embeds" yaml:"use_embeds"`
	Slow            bool   `boil:"slow" json:"slow" toml:"slow" yaml:"slow"`
	Disabled        bool   `boil:"disabled" json:"disabled" toml:"disabled" yaml:"disabled"`
	SpoilersEnabled bool   `boil:"spoilers_enabled" json:"spoilers_enabled" toml:"spoilers_enabled" yaml:"spoilers_enabled"`

	R *redditFeedR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L redditFeedL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

RedditFeed is an object representing the database table.

func FindRedditFeed

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

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

func FindRedditFeedG

func FindRedditFeedG(ctx context.Context, iD int64, selectCols ...string) (*RedditFeed, error)

FindRedditFeedG retrieves a single record by ID.

func (*RedditFeed) Delete

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

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

func (*RedditFeed) DeleteG

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

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

func (*RedditFeed) Exists

func (o *RedditFeed) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the RedditFeed row exists.

func (*RedditFeed) Insert

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

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

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

func (*RedditFeed) Reload

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

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

func (*RedditFeed) ReloadG

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

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

func (*RedditFeed) Update

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

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

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

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

func (*RedditFeed) Upsert

func (o *RedditFeed) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) 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 (*RedditFeed) UpsertG

func (o *RedditFeed) UpsertG(ctx context.Context, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error

UpsertG attempts an insert, and does an update or ignore on conflict.

type RedditFeedSlice

type RedditFeedSlice []*RedditFeed

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

func (RedditFeedSlice) DeleteAll

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

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

func (RedditFeedSlice) DeleteAllG

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

DeleteAllG deletes all rows in the slice.

func (*RedditFeedSlice) ReloadAll

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

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

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

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

func (RedditFeedSlice) UpdateAllG

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

UpdateAllG updates all rows with the specified column values.

type UpsertOptionFunc

type UpsertOptionFunc func(o *UpsertOptions)

func UpsertConflictTarget

func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc

func UpsertUpdateSet

func UpsertUpdateSet(updateSet string) UpsertOptionFunc

type UpsertOptions

type UpsertOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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