]> Cypherpunks repositories - gostls13.git/commit
database/sql: rewrite Null[T].Value method, update doc for Null[T]
authorJes Cok <xigua67damn@gmail.com>
Mon, 21 Oct 2024 04:42:51 +0000 (04:42 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 21 Oct 2024 18:42:47 +0000 (18:42 +0000)
commit971ab11ee2477cf81f7b7db520bb5c151440d298
tree14cc53873537014da6b11808e2d3b001f4130f98
parentb3a9bf1f62a1cdc792916f7fb8042c07732d8f16
database/sql: rewrite Null[T].Value method, update doc for Null[T]

Update doc for Null[T] to clarify that T should be one of the types
accepted by driver.Value.

Modify the Value() method of Null[T]:
1) recognize T implementing driver.Valuer interface and invoke it.
2) use the DefaultParameterConverter to convert native types that
are not directly supported as driver.Value types.

Fixes #69728
Fixes #69837

Change-Id: Iba782c878b2bde168125f5390abf319b88424149
GitHub-Last-Rev: 3df182d23dd57bd04828c3e9bd0c5222d8bef152
GitHub-Pull-Request: golang/go#69938
Reviewed-on: https://go-review.googlesource.com/c/go/+/620858
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/database/sql/sql.go
src/database/sql/sql_test.go