Documentation ¶
Index ¶
- func RunTransaction(ctx context.Context, dbName string, ...) (err error)
- func RunTransactionWithLock(ctx context.Context, dbName string, lock string, durationInSec int, ...) (err error)
- type Tx
- type TypedTx
- func (o *TypedTx[T]) Find(ctx context.Context, tableName string, whereSQL string, params ...any) ([]*T, error)
- func (o *TypedTx[T]) FindOne(ctx context.Context, tableName string, whereSQL string, params ...any) (*T, error)
- func (o *TypedTx[T]) Query(ctx context.Context, query string, params ...any) (result []*T, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tx ¶
func WithTx ¶
WithTx converts *sql.Tx to *txengine.Tx.
With *txengine.Tx, you have access to Exec and QueryInt
type TypedTx ¶
func WithTypedTx ¶
WithTypedTx converts *sql.Tx to *txengine.TypedTx[T].
With *txengine.TypedTx[T], you have access to FindOne[T], Find[T] and Query[T]
func (*TypedTx[T]) Find ¶
func (o *TypedTx[T]) Find(ctx context.Context, tableName string, whereSQL string, params ...any) ([]*T, error)
Find returns rows from given table type with where query
Click to show internal directories.
Click to hide internal directories.