]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.2] database/sql: document Result methods
authorAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:31:18 +0000 (11:31 +1100)
committerAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:31:18 +0000 (11:31 +1100)
««« CL 19280046 / 2ad8ac71220d
database/sql: document Result methods

Fixes #5110

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/19280046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20650043

src/pkg/database/sql/sql.go

index b24b2a8a550bd2d2bc30b74309a4373c09dbb735..dddf5a3f257257f78b7d95acbe108198ae8df200 100644 (file)
@@ -1637,7 +1637,16 @@ func (r *Row) Scan(dest ...interface{}) error {
 
 // A Result summarizes an executed SQL command.
 type Result interface {
+       // LastInsertId returns the integer generated by the database
+       // in response to a command. Typically this will be from an
+       // "auto increment" column when inserting a new row. Not all
+       // databases support this feature, and the syntax of such
+       // statements varies.
        LastInsertId() (int64, error)
+
+       // RowsAffected returns the number of rows affected by an
+       // update, insert, or delete. Not every database or database
+       // driver may support this.
        RowsAffected() (int64, error)
 }