1
0
mirror of https://github.com/golang/go synced 2024-11-24 00:20:14 -07:00

database/sql: improve unimplemented LastInsertId error message

The old one was rather confusing - it makes it sound like the user has done something wrong.

Change-Id: Ibc7411f4f1d5f6c66fbcaac64bb05b0743354418
GitHub-Last-Rev: 09290accdd
GitHub-Pull-Request: golang/go#27979
Reviewed-on: https://go-review.googlesource.com/c/139102
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Tim 2018-10-03 09:20:29 +00:00 committed by Daniel Theophanes
parent 0df9fa2ebe
commit 4559d58ced

View File

@ -469,7 +469,7 @@ type RowsAffected int64
var _ Result = RowsAffected(0) var _ Result = RowsAffected(0)
func (RowsAffected) LastInsertId() (int64, error) { func (RowsAffected) LastInsertId() (int64, error) {
return 0, errors.New("no LastInsertId available") return 0, errors.New("LastInsertId is not supported by this driver")
} }
func (v RowsAffected) RowsAffected() (int64, error) { func (v RowsAffected) RowsAffected() (int64, error) {