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