]> Cypherpunks repositories - gostls13.git/commit
database/sql: allow OpenConnector in a driver.Driver interface
authorDaniel Theophanes <kardianos@gmail.com>
Tue, 14 Nov 2017 16:53:56 +0000 (08:53 -0800)
committerDaniel Theophanes <kardianos@gmail.com>
Thu, 16 Nov 2017 22:36:07 +0000 (22:36 +0000)
commitb44b2feb914d866250f2efb744b24de0ce8c161a
tree6820e8a597a5d2e51282ca3f490f92522995d665
parent096b195df5b6b29521af3e10ef40f4118164596b
database/sql: allow OpenConnector in a driver.Driver interface

While driver.Connector was previously added to allow non-string
connection arguments and access to the context, most users of
the sql package will continue to rely on a string DSN.

Allow drivers to implement a string DSN to Connector interface
that both allows a single parsing of the string DSN and uses
the Connector interface which passes available context to
the driver dialer.

Fixes #22713

Change-Id: Ia0b862262f4c4670effe2538d0d6d43733fea18d
Reviewed-on: https://go-review.googlesource.com/77550
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
src/database/sql/driver/driver.go
src/database/sql/fakedb_test.go
src/database/sql/sql.go
src/database/sql/sql_test.go