Skip to content

Commit

Permalink
Update GoDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Nov 22, 2023
1 parent 06ba4c2 commit 99ac5e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ import (
"sync"
)

// New returns a driver.Connector, which can be passed to sql.OpenDB. This can
// be used in place of Register. It takes the same arguments as Register.
// New returns a [database/sql/driver.Connector], which can be passed to
// [database/sql.OpenDB]. This can be used in place of [Register].
// It takes the same arguments as [Register], with the omission of name.
func New(drv, dsn string, options ...func(*conn) error) driver.Connector {
return &TxDriver{
dsn: dsn,
Expand Down Expand Up @@ -132,15 +133,15 @@ type TxDriver struct {
dsn string
}

// Connect satisfies the driver.Connector interface.
// Connect satisfies the [database/sql/driver.Connector] interface.
func (d *TxDriver) Connect(context.Context) (driver.Conn, error) {
// The DSN passed here doesn't matter, since it's only used to disambiguate
// connections, but that disambiguation happens in the call to New() when
// used through the driver.Connector interface.
return d.Open("connector")
}

// Driver satisfies the driver.Connector interface.
// Driver satisfies the [database/sql/driver.Connector] interface.
func (d *TxDriver) Driver() driver.Driver {
return d
}
Expand Down

0 comments on commit 99ac5e0

Please sign in to comment.