Skip to content

Commit

Permalink
Merge pull request #1005 from igorwwwwwwwwwwwwwwwwwwww/open-pointer-r…
Browse files Browse the repository at this point in the history
…eceiver

Correctly implement database/sql/driver.Driver for better wrappability
  • Loading branch information
maddyblue committed Nov 24, 2020
2 parents 5c6816d + 730d555 commit f1ff737
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ var (
errNoLastInsertID = errors.New("no LastInsertId available after the empty statement")
)

// Compile time validation that our types implement the expected interfaces
var (
_ driver.Driver = Driver{}
)

// Driver is the Postgres database driver.
type Driver struct{}

// Open opens a new connection to the database. name is a connection string.
// Most users should only use it through database/sql package from the standard
// library.
func (d *Driver) Open(name string) (driver.Conn, error) {
func (d Driver) Open(name string) (driver.Conn, error) {
return Open(name)
}

Expand Down

0 comments on commit f1ff737

Please sign in to comment.