sqlx_locks

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SqlX Locks

go get -u github.com/storage-lock/go-sqlx-locks

Documentation

Index

Constants

View Source
const SqlxConnectionManagerName = "sqlx-connection-manager"

Variables

This section is empty.

Functions

func CreateStorageForSqlxDb

func CreateStorageForSqlxDb(db *sqlx.DB, connectionManager storage.ConnectionManager[*sql.DB]) (storage.Storage, error)

CreateStorageForSqlxDb 尝试从sqlx创建Storage

func InitGlobalSqlxLockFactory

func InitGlobalSqlxLockFactory(db *sqlx.DB) error

InitGlobalSqlxLockFactory 初始化全局的SqlxLockFactory

Types

type SqlxConnectionManager

type SqlxConnectionManager struct {
	// contains filtered or unexported fields
}

SqlxConnectionManager 从sqlx(https://github.com/jmoiron/sqlx)中复用数据库连接,如果当前项目是引入的sqlx的话则可以与其复用数据库连接资源 TODO 2023-8-4 01:32:17 单元测试

func NewSqlxConnectionManager

func NewSqlxConnectionManager(db *sqlx.DB) *SqlxConnectionManager

func (*SqlxConnectionManager) Name

func (x *SqlxConnectionManager) Name() string

func (*SqlxConnectionManager) Return

func (x *SqlxConnectionManager) Return(ctx context.Context, db *sql.DB) error

func (*SqlxConnectionManager) Shutdown

func (x *SqlxConnectionManager) Shutdown(ctx context.Context) error

func (*SqlxConnectionManager) Take

func (x *SqlxConnectionManager) Take(ctx context.Context) (*sql.DB, error)

type SqlxLockFactory

type SqlxLockFactory struct {
	*storage_lock_factory.StorageLockFactory[*sql.DB]
	// contains filtered or unexported fields
}
var GlobalSqlxLockFactory *SqlxLockFactory

func NewSqlxLockFactory

func NewSqlxLockFactory(db *sqlx.DB) (*SqlxLockFactory, error)

Jump to

Keyboard shortcuts

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