Source File
result.go
Belonging Package
github.com/go-sql-driver/mysql
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package//// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.//// This Source Code Form is subject to the terms of the Mozilla Public// License, v. 2.0. If a copy of the MPL was not distributed with this file,// You can obtain one at http://mozilla.org/MPL/2.0/.package mysqlimport// Result exposes data not available through *connection.Result.//// This is accessible by executing statements using sql.Conn.Raw() and// downcasting the returned result://// res, err := rawConn.Exec(...)// res.(mysql.Result).AllRowsAffected()type Result interface {driver.Result// AllRowsAffected returns a slice containing the affected rows for each// executed statement.AllRowsAffected() []int64// AllLastInsertIds returns a slice containing the last inserted ID for each// executed statement.AllLastInsertIds() []int64}type mysqlResult struct {// One entry in both slices is created for every executed statement result.affectedRows []int64insertIds []int64}func ( *mysqlResult) () (int64, error) {return .insertIds[len(.insertIds)-1], nil}func ( *mysqlResult) () (int64, error) {return .affectedRows[len(.affectedRows)-1], nil}func ( *mysqlResult) () []int64 {return append([]int64{}, .insertIds...) // defensive copy}func ( *mysqlResult) () []int64 {return append([]int64{}, .affectedRows...) // defensive copy}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |