entities

package
v0.0.0-...-a6c5799 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArticleColumns = struct {
	ID    string
	Title string
	Body  string
}{
	ID:    "id",
	Title: "title",
	Body:  "body",
}
View Source
var ArticleRels = struct {
}{}

ArticleRels is where relationship names are stored.

View Source
var ArticleTableColumns = struct {
	ID    string
	Title string
	Body  string
}{
	ID:    "articles.id",
	Title: "articles.title",
	Body:  "articles.body",
}
View Source
var ArticleWhere = struct {
	ID    whereHelperint64
	Title whereHelperstring
	Body  whereHelperstring
}{
	ID:    whereHelperint64{/* contains filtered or unexported fields */},
	Title: whereHelperstring{/* contains filtered or unexported fields */},
	Body:  whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("entities: 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 {
	Articles string
}{
	Articles: "articles",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddArticleHook

func AddArticleHook(hookPoint boil.HookPoint, articleHook ArticleHook)

AddArticleHook registers your hook function for all future operations.

func ArticleExists

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

ArticleExists checks if the Article row exists.

func Articles

func Articles(mods ...qm.QueryMod) articleQuery

Articles 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 Article

type Article struct {
	ID    int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Title string `boil:"title" json:"title" toml:"title" yaml:"title"`
	Body  string `boil:"body" json:"body" toml:"body" yaml:"body"`

	R *articleR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L articleL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Article is an object representing the database table.

func FindArticle

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

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

func (*Article) Delete

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

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

func (*Article) Exists

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

Exists checks if the Article row exists.

func (*Article) Insert

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

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

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

func (*Article) Update

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

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

func (o *Article) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ArticleHook

type ArticleHook func(context.Context, boil.ContextExecutor, *Article) error

ArticleHook is the signature for custom Article hook methods

type ArticleSlice

type ArticleSlice []*Article

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

func (ArticleSlice) DeleteAll

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

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

func (*ArticleSlice) ReloadAll

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

func (o ArticleSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, 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.

Jump to

Keyboard shortcuts

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