MCPcopy Create free account
hub / github.com/temporalio/temporal / newDB

Function newDB

common/persistence/sql/sqlplugin/postgresql/db.go:46–64  ·  view source on GitHub ↗

newDB returns an instance of DB, which is a logical connection to the underlying postgresql database

(
	dbKind sqlplugin.DbKind,
	dbName string,
	dbDriver driver.Driver,
	handle *sqlplugin.DatabaseHandle,
	tx *sqlx.Tx,
	logger log.Logger,
)

Source from the content-addressed store, hash-verified

44// newDB returns an instance of DB, which is a logical
45// connection to the underlying postgresql database
46func newDB(
47 dbKind sqlplugin.DbKind,
48 dbName string,
49 dbDriver driver.Driver,
50 handle *sqlplugin.DatabaseHandle,
51 tx *sqlx.Tx,
52 logger log.Logger,
53) *db {
54 mdb := &db{
55 dbKind: dbKind,
56 dbName: dbName,
57 dbDriver: dbDriver,
58 handle: handle,
59 tx: tx,
60 logger: logger,
61 }
62 mdb.converter = &converter{}
63 return mdb
64}
65
66func (pdb *db) conn() sqlplugin.Conn {
67 if pdb.tx != nil {

Callers 2

CreateDBMethod · 0.70
BeginTxMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected