databases

package
v0.19.8 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RedisClient *redis.Client
	RedisOnce   sync.Once
)

Functions

func CloseRedisClient

func CloseRedisClient() error

CloseRedisClient gracefully closes the Redis connection

func GetPoolStats

func GetPoolStats() *redis.PoolStats

GetPoolStats returns current pool statistics

func GetRedisClient

func GetRedisClient() *redis.Client

func WithTransaction added in v0.19.4

func WithTransaction(fn func(tx orm.Query) error) error

WithTransaction begins a database transaction, executes fn within it, and commits on success or rolls back on failure or panic.

func WithTransactionQuery added in v0.19.4

func WithTransactionQuery(q orm.Query, fn func(tx orm.Query) error) error

WithTransactionQuery is the testable core — accepts an orm.Query directly.

Types

type TransactionFunc added in v0.19.4

type TransactionFunc func(fn func(tx orm.Query) error) error

TransactionFunc is the type for a function that wraps logic inside a DB transaction.

Jump to

Keyboard shortcuts

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