sqldb_storage

package module
v0.0.0-...-478f6e1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 13 Imported by: 6

README

sql.DB Storage

go get -u github.com/storage-lock/go-sqldb-storage

Documentation

Index

Constants

View Source
const (
	DriverNameMysql      = "mysql"
	DriverNamePostgresql = "postgres"
	DriverNameSqlServer  = "sqlserver"
	DriverNameSqlite3    = "sqlite3"
)

TODO 2023-8-6 23:09:42 扩展更多支持的驱动

Variables

This section is empty.

Functions

func GetDriverNameForSqlDb

func GetDriverNameForSqlDb(db *sql.DB) (string, error)

GetDriverNameForSqlDb 根据sql.Driver的不同实现来识别驱动的名称

func NewStorage

func NewStorage(db *sql.DB) (storage.Storage, error)

NewStorage 根据sql.DB创建对应的Storage

func NewStorageByConnectionManager

func NewStorageByConnectionManager(ctx context.Context, connectionManager storage.ConnectionManager[*sql.DB]) (sqlDbStorage storage.Storage, returnError error)

NewStorageByConnectionManager 从sql.DB的连接管理器中创建Storage

func NewStorageByDriverName

func NewStorageByDriverName(driverName string, connectionManager storage.ConnectionManager[*sql.DB]) (storage.Storage, error)

NewStorageByDriverName 根据驱动名称创建对应的Storage

Types

This section is empty.

Jump to

Keyboard shortcuts

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