MCPcopy
hub / github.com/jmoiron/sqlx / NewDb

Function NewDb

sqlx.go:254–256  ·  view source on GitHub ↗

NewDb returns a new sqlx DB wrapper for a pre-existing *sql.DB. The driverName of the original database is required for named query support. lint:ignore ST1003 changing this would break the package interface.

(db *sql.DB, driverName string)

Source from the content-addressed store, hash-verified

252//
253//lint:ignore ST1003 changing this would break the package interface.
254func NewDb(db *sql.DB, driverName string) *DB {
255 return &DB{DB: db, driverName: driverName, Mapper: mapper()}
256}
257
258// DriverName returns the driverName passed to the Open function for this DB.
259func (db *DB) DriverName() string {

Callers 2

TestUsageFunction · 0.85
TestUsageContextFunction · 0.85

Calls 1

mapperFunction · 0.85

Tested by 2

TestUsageFunction · 0.68
TestUsageContextFunction · 0.68