db

package
v0.0.0-...-de99a23 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MySQL     = "mysql"
	SQLite    = "sqlite3"
	Postgres  = "postgres"
	SQLServer = "mssql"
)

Variables

View Source
var DefaultDbManger = NewDbManager()

Functions

func DbManagerNameExist

func DbManagerNameExist(err error) bool

func DbManagerNameNotFound

func DbManagerNameNotFound(err error) bool

func DbManagerNameOpen

func DbManagerNameOpen(err error) bool

Types

type DbInfo

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

func Open

func Open(name, driverName, dataSourceName string) (*DbInfo, error)

func OpenDB

func OpenDB(name, driverName string, db *sql.DB) *DbInfo

func (*DbInfo) Close

func (d *DbInfo) Close() error

func (*DbInfo) DB

func (d *DbInfo) DB() *sql.DB

type DbManager

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

func NewDbManager

func NewDbManager() *DbManager

func (*DbManager) Add

func (m *DbManager) Add(dbInfo *DbInfo) error

func (*DbManager) Exist

func (m *DbManager) Exist(name string) bool

func (*DbManager) Get

func (m *DbManager) Get(name string) (*DbInfo, error)

func (*DbManager) Open

func (m *DbManager) Open(name, driverName, dataSourceName string) error

func (*DbManager) OpenDB

func (m *DbManager) OpenDB(name, driverName string, db *sql.DB) error

func (*DbManager) Remove

func (m *DbManager) Remove(name string) (*DbInfo, error)

Jump to

Keyboard shortcuts

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