xugu_result.go 958 B

1234567891011121314151617181920212223242526272829303132
  1. package xugu
  2. import "fmt"
  3. type xuguResult struct {
  4. // Returns the number of rows affected
  5. // by update, delete and other related operations
  6. affectedRows int64
  7. // Returns the GUID number of
  8. // the insert operation (not supported)
  9. insertId int64
  10. }
  11. // LastInsertId returns the integer generated by the database
  12. // in response to a command. Typically this will be from an
  13. // "auto increment" column when inserting a new row. Not all
  14. // databases support this feature, and the syntax of such
  15. // statements varies.
  16. func (self *xuguResult) LastInsertId() (int64, error) {
  17. fmt.Println(">>>>>(self *xugusqlResult) LastInsertId()")
  18. return self.insertId, nil
  19. }
  20. // RowsAffected returns the number of rows affected by an
  21. // update, insert, or delete. Not every database or database
  22. // driver may support this.
  23. func (self *xuguResult) RowsAffected() (int64, error) {
  24. fmt.Println(">>>>>(self *xugusqlResult) RowsAffected()")
  25. return self.affectedRows, nil
  26. }