]> Cypherpunks repositories - gostls13.git/commit
database/sql: add OpenDB to directly create a *DB without a DSN.
authorJames Lawrence <jljatone@gmail.com>
Sat, 5 Aug 2017 10:04:19 +0000 (06:04 -0400)
committerDaniel Theophanes <kardianos@gmail.com>
Sat, 23 Sep 2017 20:47:06 +0000 (20:47 +0000)
commite6358c798b3001e98b6f7f4c3e2d906cf48533b2
tree2cccc26a32cc67e720372a67423c7418f4382c5d
parent6936671ed1c3a1dd25e0eea635ee2bdc86acd463
database/sql: add OpenDB to directly create a *DB without a DSN.

The current Open method limits the ability for driver maintainers
to expose options for their drivers by forcing all the configuration
to pass through the DSN in order to create a *DB.

This CL allows driver maintainers to write their own initialization
functions that return a *DB making configuration of the underlying
drivers easier.

Fixes #20268

Change-Id: Ib10b794f36a201bbb92c23999c8351815d38eedb
Reviewed-on: https://go-review.googlesource.com/53430
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/database/sql/driver/driver.go
src/database/sql/sql.go
src/database/sql/sql_test.go