Documentation
¶
Index ¶
- Constants
- func Default() ctx.ServicePackage
- func IsErrNotFound(err error) bool
- func SessionContextReturning[T any](context context.Context, connection Connection, ...) (T, error)
- func SessionContextTxReturning[T any](context context.Context, connection Connection, ...) (T, error)
- func SessionReturning[T any](connection Connection, sessionFn func(session *Session) (T, error)) (T, error)
- func SessionTxReturning[T any](connection Connection, txFn func(session *Session) (T, error)) (T, error)
- func TxReturning[T any](session *Session, txFn func(session *Session) (T, error)) (T, error)
- type Connection
- type Paginator
- type Session
Constants ¶
View Source
const DefaultFetchSize = 1000
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default() ctx.ServicePackage
func IsErrNotFound ¶
func SessionContextReturning ¶
func SessionReturning ¶
func SessionReturning[T any](connection Connection, sessionFn func(session *Session) (T, error)) (T, error)
func SessionTxReturning ¶
func SessionTxReturning[T any](connection Connection, txFn func(session *Session) (T, error)) (T, error)
Types ¶
type Connection ¶
type Connection interface { Init() AutoMigrate(models ...any) Session(session func(session *Session) error) error SessionContext(context context.Context, session func(session *Session) error) error Stats() (sql.DBStats, error) Check() error Health() health.ServiceHealth }
func NewConnection ¶
func NewConnection(name string, configPrefix string, isDefault bool, isCritical bool) Connection
Click to show internal directories.
Click to hide internal directories.