conns

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = types.Module{
	{CreateFunc: NewConns},
}.
	Append(postrgres.Module).
	Append(elastic.Module)

Functions

This section is empty.

Types

type Conns

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

func NewConns

func NewConns(
	logger *zap.Logger,
	elastic *elasticsearch.Client,
	sqlxPoolDB map[string]*sqlx.DB,
	pgxPoolDB map[string]*pgxpool.Pool,
	sqlConns map[string]connectors.DBConnector[*sqlx.DB, *sqlx.Tx],
	goquConns map[string]connectors.DBConnector[*goqu.Database, *goqu.TxDatabase],
	pgxConns map[string]connectors.DBConnector[dbtypes.PgxConn, dbtypes.PgxTx],
) *Conns

func (*Conns) Close

func (c *Conns) Close()

func (*Conns) GetDB deprecated

func (c *Conns) GetDB() (*sqlx.DB, error)

Deprecated: Use GetSQLConnByName instead

func (*Conns) GetElastic

func (c *Conns) GetElastic() (*elasticsearch.Client, error)

func (*Conns) GetGoQuConn

func (c *Conns) GetGoQuConn(nameConn string) (connectors.DBConnector[*goqu.Database, *goqu.TxDatabase], error)

GetGoQuConn создает слой sql-builder'а для конструирования запросов в БД. Также он умеет делать scan в структуры

func (*Conns) GetPGXConnByName added in v1.0.7

func (c *Conns) GetPGXConnByName(nameConn string) (connectors.DBConnector[dbtypes.PgxConn, dbtypes.PgxTx], error)

func (*Conns) GetSQLConn deprecated

func (c *Conns) GetSQLConn() (connectors.DBConnector[*sqlx.DB, *sqlx.Tx], error)

Deprecated: Use GetSQLConnByName instead

func (*Conns) GetSQLConnByName added in v1.0.1

func (c *Conns) GetSQLConnByName(nameConn string) (connectors.DBConnector[*sqlx.DB, *sqlx.Tx], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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