1234567891011121314151617181920212223242526272829303132 |
- package xugu
- import "fmt"
- type xuguResult struct {
- // Returns the number of rows affected
- // by update, delete and other related operations
- affectedRows int64
- // Returns the GUID number of
- // the insert operation (not supported)
- insertId int64
- }
- // 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.
- func (self *xuguResult) LastInsertId() (int64, error) {
- fmt.Println(">>>>>(self *xugusqlResult) LastInsertId()")
- return self.insertId, nil
- }
- // RowsAffected returns the number of rows affected by an
- // update, insert, or delete. Not every database or database
- // driver may support this.
- func (self *xuguResult) RowsAffected() (int64, error) {
- fmt.Println(">>>>>(self *xugusqlResult) RowsAffected()")
- return self.affectedRows, nil
- }
|