db

package module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() jelly.Module

func RegisterProvider

func RegisterProvider(provider Provider)

func RunTx

func RunTx(ctx context.Context, manager SQLTxManager, fn func(context.Context) error) (err error)

func SQLDB

func SQLDB() *sql.DB

func SQLTx

func SQLTx(ctx context.Context) *sql.Tx

Types

type Provider

type Provider interface {
	Name() string
	Open(context.Context, *jelly.App) (*sql.DB, error)
	Close(context.Context) error
}

type SQLTxManager

type SQLTxManager = sqltx.TxManager
var TxManager SQLTxManager = txManager{}
var TxManagerMock SQLTxManager = sqltx.NewTxMockManager()

type Session

type Session = contracts.Session

func DB

func DB(ctx context.Context) Session

type Tx

type Tx = sqltx.Tx

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL