Documentation
¶
Index ¶
- func Count[T any](o *Db) (int, error)
- func Delete[T any](o *Db, fn func(*bun.DeleteQuery)) (int64, error)
- func DeleteAll[T any](o *Db) (int64, error)
- func Diff[T any](a, b T) []string
- func Equal[T any](a, b T) bool
- func PkName(model any) (name string, err error)
- func UpdateDiff[T any](db *Db, prev, curr T) (columns []string, err error)
- type Db
- func (o *Db) Await(timeout time.Duration) time.Duration
- func (o *Db) Close()
- func (o *Db) Count(model any) (int, error)
- func (o *Db) Delete(model any, fn func(*bun.DeleteQuery)) (int64, error)
- func (o *Db) DeleteAll(model any) (int64, error)
- func (o *Db) Exec(query string, arg ...any) error
- func (o *Db) Exists(model any, fn func(*bun.SelectQuery)) (bool, error)
- func (o *Db) ExistsPk(model any) (bool, error)
- func (o *Db) Format(query string, arg ...any) string
- func (o *Db) GetIfExists(model any, fn func(*bun.SelectQuery)) (bool, error)
- func (o *Db) GetIfExistsPk(model any) (bool, error)
- func (o *Db) Insert(model any) error
- func (o *Db) Migrator() *Migrator
- func (o *Db) NewSelect(model any) *bun.SelectQuery
- func (o *Db) Ok() bool
- func (o *Db) Ping() bool
- func (o *Db) Scan(model any, query string, arg ...any) error
- func (o *Db) Select(model any, fn func(*bun.SelectQuery)) error
- func (o *Db) SelectAll(model any) error
- func (o *Db) SelectIn(model any, ids any) error
- func (o *Db) SelectPk(model any) error
- func (o *Db) Truncate(model any) error
- func (o *Db) Update(model any, fn func(*bun.UpdateQuery)) error
- func (o *Db) UpdateAll(model any) error
- func (o *Db) UpdateIn(model any, ids any) error
- func (o *Db) UpdatePk(model any) error
- func (o *Db) Upsert(model any) error
- func (o *Db) Wait(timeout time.Duration) bool
- type Migrator
- func (o *Migrator) Exec(fs fs.FS, lock bool, rollbackLast bool, previewDown bool, repairDown bool) (ok bool)
- func (o *Migrator) WithAutoDownSql(v bool) *Migrator
- func (o *Migrator) WithMarkAppliedOnSuccess(v bool) *Migrator
- func (o *Migrator) WithRollbackLost(v bool) *Migrator
- func (o *Migrator) WithSaveDownSql(v bool) *Migrator
- type Options
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Migrator ¶ added in v0.4.2
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶ added in v0.4.2
func (*Migrator) WithAutoDownSql ¶ added in v0.4.2
func (*Migrator) WithMarkAppliedOnSuccess ¶ added in v0.4.2
func (*Migrator) WithRollbackLost ¶ added in v0.4.2
func (*Migrator) WithSaveDownSql ¶ added in v0.4.2
type Updater ¶ added in v0.2.8
type Updater[T any] struct { // contains filtered or unexported fields }
func NewUpdater ¶ added in v0.2.8
Source Files
¶
Click to show internal directories.
Click to hide internal directories.