package xugu type xugusqlResult struct { // Returns the number of rows affected // by update, delete and other related operations // 返回受 update、delete 和其他相关操作影响的行数 affectedRows int64 // Returns the GUID number of // the insert operation (not supported) // 返回 insert 操作的 GUID 编号(不支持) 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. // LastInsertId 返回数据库响应命令生成的整数。 // 通常这是在插入新行时来自“自动递增”列的值。 // 并非所有数据库都支持此功能,且此类语句的语法各不相同。 func (self *xugusqlResult) LastInsertId() (int64, error) { 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. // RowsAffected 返回受 update、insert 或 delete 影响的行数。 // 并非每个数据库或数据库驱动都支持此功能。 func (self *xugusqlResult) RowsAffected() (int64, error) { 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 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 *xugusqlConn // 数据库连接属性 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 // 插入类型的标记 } type RSMemStruct struct { Head *Block // 头部块 CurBlok *Block // 当前块 }