Documentation
¶
Index ¶
- Variables
- func AddCounterHook(hookPoint boil.HookPoint, counterHook CounterHook)
- func CounterExists(ctx context.Context, exec boil.ContextExecutor, userID string) (bool, error)
- func Counters(mods ...qm.QueryMod) counterQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- type Counter
- func (o *Counter) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Counter) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Counter) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Counter) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Counter) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Counter) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type CounterHook
- type CounterSlice
- type M
Constants ¶
This section is empty.
Variables ¶
var CounterColumns = struct { UserID string Count string }{ UserID: "user_id", Count: "count", }
var CounterRels = struct {
}{}
CounterRels is where relationship names are stored.
var CounterTableColumns = struct { UserID string Count string }{ UserID: "counters.user_id", Count: "counters.count", }
var CounterWhere = struct { UserID whereHelperstring Count whereHelperint64 }{ UserID: whereHelperstring{/* contains filtered or unexported fields */}, Count: whereHelperint64{/* contains filtered or unexported fields */}, }
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 TableNames = struct { Counters string }{ Counters: "counters", }
var ViewNames = struct {
}{}
Functions ¶
func AddCounterHook ¶
func AddCounterHook(hookPoint boil.HookPoint, counterHook CounterHook)
AddCounterHook registers your hook function for all future operations.
func CounterExists ¶
CounterExists checks if the Counter row exists.
Types ¶
type Counter ¶
type Counter struct {
UserID string `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
Count int64 `boil:"count" json:"count" toml:"count" yaml:"count"`
R *counterR `boil:"-" json:"-" toml:"-" yaml:"-"`
L counterL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
Counter is an object representing the database table.
func FindCounter ¶
func FindCounter(ctx context.Context, exec boil.ContextExecutor, userID string, selectCols ...string) (*Counter, error)
FindCounter retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Counter) Delete ¶
Delete deletes a single Counter record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Counter) Insert ¶
func (o *Counter) 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 (*Counter) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Counter) Update ¶
func (o *Counter) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Counter. 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 (*Counter) Upsert ¶
func (o *Counter) 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 CounterHook ¶
CounterHook is the signature for custom Counter hook methods
type CounterSlice ¶
type CounterSlice []*Counter
CounterSlice is an alias for a slice of pointers to Counter. This should almost always be used instead of []Counter.
func (CounterSlice) DeleteAll ¶
func (o CounterSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*CounterSlice) ReloadAll ¶
func (o *CounterSlice) 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 (CounterSlice) UpdateAll ¶
func (o CounterSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.