Documentation ¶
Index ¶
- Variables
- func AddShortenerHook(hookPoint boil.HookPoint, shortenerHook ShortenerHook)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func ShortenerExists(ctx context.Context, exec boil.ContextExecutor, code string) (bool, error)
- func Shorteners(mods ...qm.QueryMod) shortenerQuery
- type M
- type Shortener
- func (o *Shortener) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Shortener) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Shortener) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Shortener) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Shortener) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type ShortenerHook
- type ShortenerSlice
Constants ¶
This section is empty.
Variables ¶
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.
var ShortenerColumns = struct { Code string URL string Visited string Count string }{ Code: "code", URL: "url", Visited: "visited", Count: "count", }
var ShortenerRels = struct {
}{}
ShortenerRels is where relationship names are stored.
var ShortenerWhere = struct { Code whereHelperstring URL whereHelperstring Visited whereHelperbool Count whereHelperint }{ Code: whereHelperstring{/* contains filtered or unexported fields */}, URL: whereHelperstring{/* contains filtered or unexported fields */}, Visited: whereHelperbool{/* contains filtered or unexported fields */}, Count: whereHelperint{/* contains filtered or unexported fields */}, }
var TableNames = struct { Shortener string }{ Shortener: "shortener", }
Functions ¶
func AddShortenerHook ¶
func AddShortenerHook(hookPoint boil.HookPoint, shortenerHook ShortenerHook)
AddShortenerHook registers your hook function for all future operations.
func ShortenerExists ¶
ShortenerExists checks if the Shortener row exists.
func Shorteners ¶
Shorteners 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 Shortener ¶
type Shortener struct { Code string `boil:"code" json:"code" toml:"code" yaml:"code"` URL string `boil:"url" json:"url" toml:"url" yaml:"url"` Visited bool `boil:"visited" json:"visited" toml:"visited" yaml:"visited"` Count int `boil:"count" json:"count" toml:"count" yaml:"count"` R *shortenerR `boil:"-" json:"-" toml:"-" yaml:"-"` L shortenerL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Shortener is an object representing the database table.
func FindShortener ¶
func FindShortener(ctx context.Context, exec boil.ContextExecutor, code string, selectCols ...string) (*Shortener, error)
FindShortener retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Shortener) Delete ¶
Delete deletes a single Shortener record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Shortener) Insert ¶
func (o *Shortener) 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 (*Shortener) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Shortener) Update ¶
func (o *Shortener) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Shortener. 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 (*Shortener) Upsert ¶
func (o *Shortener) 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 ShortenerHook ¶
ShortenerHook is the signature for custom Shortener hook methods
type ShortenerSlice ¶
type ShortenerSlice []*Shortener
ShortenerSlice is an alias for a slice of pointers to Shortener. This should generally be used opposed to []Shortener.
func (ShortenerSlice) DeleteAll ¶
func (o ShortenerSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*ShortenerSlice) ReloadAll ¶
func (o *ShortenerSlice) 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 (ShortenerSlice) UpdateAll ¶
func (o ShortenerSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.