Skip to content

Commit

Permalink
Correctly implement database/sql/driver.Driver for better wrappability
Browse files Browse the repository at this point in the history
  • Loading branch information
igorwwwwwwwwwwwwwwwwwwww committed Oct 22, 2020
1 parent 083382b commit 730d555
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 730d555

Please sign in to comment.