metaDataBase

package
v0.0.0-...-05e86ca Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPgStorage

func GetPgStorage(connectStr string) (*pgxpool.Pool, error)

func SetConnectOption

func SetConnectOption(source map[string]string)

func SetDbFilePath

func SetDbFilePath(filePath string)

Types

type DBStatus

type DBStatus uint8

uuid.New().String()

const (
	StOpened DBStatus = iota
	StClosed
)

type TPGStorage

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

func GetPgServ

func GetPgServ() (*TPGStorage, error)

func (*TPGStorage) Close

func (pg *TPGStorage) Close()

func (*TPGStorage) Execute

func (pg *TPGStorage) Execute(strSQL string, args ...interface{}) (int64, error)

func (*TPGStorage) ExecuteDDLs

func (pg *TPGStorage) ExecuteDDLs(ctx context.Context, ddlList []string) error

func (*TPGStorage) ExecuteSQL

func (pg *TPGStorage) ExecuteSQL(ctx context.Context, strSQL string, args ...interface{}) error

func (*TPGStorage) GetConn

func (pg *TPGStorage) GetConn(ctx context.Context) (*pgxpool.Conn, error)

func (*TPGStorage) GetSchema

func (pg *TPGStorage) GetSchema() string

func (*TPGStorage) QuerySQL

func (pg *TPGStorage) QuerySQL(strSQL string, args ...interface{}) (pgx.Rows, error)

type TStorage

type TStorage struct {
	*sqlx.DB
	*sync.Mutex
	// contains filtered or unexported fields
}

func GetDbServ

func GetDbServ(tableDDLs ...string) (*TStorage, error)

func (*TStorage) CloseDB

func (dbs *TStorage) CloseDB() error

func (*TStorage) ExecuteSQL

func (dbs *TStorage) ExecuteSQL(strSQL string, args ...interface{}) error

func (*TStorage) OpenDB

func (dbs *TStorage) OpenDB() error

func (*TStorage) QuerySQL

func (dbs *TStorage) QuerySQL(strSQL string, args ...interface{}) (*sqlx.Rows, error)

Jump to

Keyboard shortcuts

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