xugu_result.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. }
  27. // type FieldInfo struct {
  28. // TabName string // 基表名
  29. // Name string // 列名
  30. // Alias string // 别名
  31. // TypeID uint32 // 类型 ID
  32. // CTypeID uint32 // ODBC 的 SQL_C_XXX 类型
  33. // Modi uint32 // 列修改集合
  34. // Flags uint32 // 列标志,用于是否可为空,是否为主键等
  35. // Offset uint32 // 列数据偏移量
  36. // }
  37. // type RhRow struct {
  38. // FieldNum int16 // 字段数量
  39. // State int16 // 状态
  40. // Mbmk [20]byte // 标记
  41. // RowData [4]byte // 行数据(长度不固定)
  42. // }
  43. // type Block struct {
  44. // Next *Block // 下一个块指针
  45. // BuffSize int // 缓冲区大小
  46. // Off int // 偏移量
  47. // Res int // 资源
  48. // BlkNo int // 块编号(未使用)
  49. // RowNo int64 // 行号(未使用)
  50. // Data []byte // 数据
  51. // }
  52. // type RSMemStruct struct {
  53. // Head *Block // 头部块
  54. // CurBlok *Block // 当前块
  55. // }
  56. // type Result struct {
  57. // Type HANDLE_TYPE // 句柄类型
  58. // State int32 // 状态
  59. // FieldNum uint32 // 字段数量
  60. // ColInfos []FieldInfo // SELECT 返回的结果集列属性信息
  61. // RowSize uint32 // 行大小
  62. // ICurrPos int32 // 当前行位置
  63. // SlotNum int64 // 槽数量
  64. // Rows [][][]interface{} // 行数据
  65. // RowNum int64 // 记录计数器
  66. // CurRec *RhRow // 当前记录
  67. // ErrStr string // 错误信息字符串
  68. // DbcFlob *xuguConn // 数据库连接属性
  69. // IsMultiResult bool // 是否多结果集
  70. // NextResult *Result // 下一个结果集
  71. // PBlokmemls *RSMemStruct // 内存块链表,添加于 2019-05-06
  72. // SQLType int // SQL 类型:0 未知, 1 插入, 2 更新, 3 删除, 4 查询, 5 其他, 6 创建, 7 修改, 8 开始, 9 声明, 10 设置
  73. // EffectNum int // 更新、删除类型的影响行数
  74. // InsertBmk [32]byte // 插入类型的标记
  75. // }