Documentation
¶
Index ¶
- func ContextWithDB(ctx context.Context, db bun.IDB) context.Context
- func DBFromContext(ctx context.Context) bun.IDB
- func RunInTx(ctx context.Context, opts *sql.TxOptions, fn func(context.Context) error) error
- type Model
- func (m Model[T]) All(ctx context.Context) (models []T, err error)
- func (m Model[T]) Create(ctx context.Context, values ...Values) (*T, error)
- func (m Model[T]) Delete(ctx context.Context) error
- func (m Model[T]) First(ctx context.Context) (*T, error)
- func (m Model[T]) Limit(n int) Model[T]
- func (m Model[T]) Update(ctx context.Context, values ...Values) (*T, error)
- func (m Model[T]) Where(values Values) Model[T]
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model[T any] struct { // contains filtered or unexported fields }
type Values ¶
func (Values) InsertQuery ¶
func (values Values) InsertQuery(iq *bun.InsertQuery) *bun.InsertQuery
func (Values) QueryBuilder ¶
func (values Values) QueryBuilder(qb bun.QueryBuilder) bun.QueryBuilder
func (Values) UpdateQuery ¶
func (values Values) UpdateQuery(uq *bun.UpdateQuery) *bun.UpdateQuery
Click to show internal directories.
Click to hide internal directories.