浏览代码

优化table row

yjp 3 月之前
父节点
当前提交
5c96f0ca94
共有 11 个文件被更改,包括 582 次插入394 次删除
  1. 5 14
      client/client.go
  2. 3 3
      client/client_cmd_request.go
  3. 11 0
      client/error.go
  4. 304 0
      client/table_row.go
  5. 35 126
      dpsv1/client.go
  6. 15 3
      dpsv1/transaction.go
  7. 5 5
      instance_query.go
  8. 20 29
      pb/v1/request/command.pb.go
  9. 20 29
      pb/v1/response/query.pb.go
  10. 20 25
      test/v1/sdk.go
  11. 144 160
      test/v1/v1_test.go

+ 5 - 14
client/client.go

@@ -1,7 +1,6 @@
 package client
 
 import (
-	"strings"
 	"time"
 )
 
@@ -28,14 +27,6 @@ func FormatLastEventTime(dataMap map[string]any, format string) string {
 	return dataMap[columnLastEventTime].(time.Time).Format(format)
 }
 
-func IsErrorDBRecordHasExist(err error) bool {
-	return strings.Contains(err.Error(), "记录已存在")
-}
-
-func IsErrorDBRecordNotExist(err error) bool {
-	return strings.Contains(err.Error(), "记录不存在")
-}
-
 type Client interface {
 	AutoMigrate(request *AutoMigrateRequest) error
 	Transaction(txFunc TransactionFunc) error
@@ -45,11 +36,11 @@ type Client interface {
 	DeleteBatch(request *DeleteBatchRequest) (string, error)
 	Update(request *UpdateRequest) (string, error)
 	Replay(request *ReplayRequest) (string, error)
-	QueryByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, []map[string]any, int64, error)
-	CommonQuery(request *CommonQueryRequest) (string, []map[string]any, int64, error)
-	QueryOnlyByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, []map[string]any, error)
-	CommonQueryOnly(request *CommonQueryRequest) (string, []map[string]any, error)
-	QueryByKeys(request *QueryByKeysRequest) (string, map[string]any, error)
+	QueryByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, *TableRows, int64, error)
+	CommonQuery(request *CommonQueryRequest) (string, *TableRows, int64, error)
+	QueryOnlyByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, *TableRows, error)
+	CommonQueryOnly(request *CommonQueryRequest) (string, *TableRows, error)
+	QueryByKeys(request *QueryByKeysRequest) (string, *TableRow, error)
 	CountWhere(request *CountWhereRequest) (string, int64, error)
 	CommonCount(request *CommonCountRequest) (string, int64, error)
 	EventQueryByKeys(request *EventQueryByKeysRequest) (string, []EventInfo, int64, error)

+ 3 - 3
client/client_cmd_request.go

@@ -14,7 +14,7 @@ type InsertRequest struct {
 	TablePrefixWithSchema string
 	Version               string
 	KeyColumns            []string
-	TableRow              map[string]any
+	TableRow              *TableRow
 	UserID                string
 }
 
@@ -27,7 +27,7 @@ type InsertTableRowItem struct {
 	TablePrefixWithSchema string
 	Version               string
 	KeyColumns            []string
-	TableRows             []map[string]any
+	TableRows             []*TableRow
 }
 
 type DeleteRequest struct {
@@ -52,7 +52,7 @@ type UpdateRequest struct {
 	TablePrefixWithSchema string
 	Version               string
 	KeyValues             map[string]string
-	NewTableRow           map[string]any
+	NewTableRow           *TableRow
 	UserID                string
 }
 

+ 11 - 0
client/error.go

@@ -0,0 +1,11 @@
+package client
+
+import "strings"
+
+func IsErrorDBRecordHasExist(err error) bool {
+	return strings.Contains(err.Error(), "记录已存在")
+}
+
+func IsErrorDBRecordNotExist(err error) bool {
+	return strings.Contains(err.Error(), "记录不存在")
+}

+ 304 - 0
client/table_row.go

@@ -0,0 +1,304 @@
+package client
+
+import (
+	"errors"
+	"git.sxidc.com/service-supports/dps-sdk/pb/v1/request"
+	"git.sxidc.com/service-supports/dps-sdk/pb/v1/response"
+	"reflect"
+	"strings"
+	"time"
+)
+
+type TableRow struct {
+	row map[string]any
+}
+
+func NewTableRow() *TableRow {
+	return &TableRow{row: make(map[string]any)}
+}
+
+func (tableRow *TableRow) AddColumnValueTime(columnName string, value time.Time) *TableRow {
+	tableRow.row[columnName] = value
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueBool(columnName string, value bool) *TableRow {
+	tableRow.row[columnName] = value
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueString(columnName string, value string) *TableRow {
+	tableRow.row[columnName] = value
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueInt(columnName string, value int) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueInt8(columnName string, value int8) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueInt16(columnName string, value int16) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueInt32(columnName string, value int32) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueInt64(columnName string, value int64) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueUint(columnName string, value uint) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueUint8(columnName string, value uint8) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueUint16(columnName string, value uint16) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueUint32(columnName string, value uint32) *TableRow {
+	tableRow.row[columnName] = uint64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueUint64(columnName string, value uint64) *TableRow {
+	tableRow.row[columnName] = value
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueFloat32(columnName string, value float32) *TableRow {
+	tableRow.row[columnName] = float64(value)
+	return tableRow
+}
+
+func (tableRow *TableRow) AddColumnValueFloat64(columnName string, value float64) *TableRow {
+	tableRow.row[columnName] = value
+	return tableRow
+}
+
+func (tableRow *TableRow) ColumnValueTime(columnName string) time.Time {
+	value, ok := tableRow.row[columnName].(time.Time)
+	if !ok {
+		return time.Time{}
+	}
+
+	return value
+}
+
+func (tableRow *TableRow) ColumnValueBool(columnName string) bool {
+	value, ok := tableRow.row[columnName].(bool)
+	if !ok {
+		return false
+	}
+
+	return value
+}
+
+func (tableRow *TableRow) ColumnValueString(columnName string) string {
+	value, ok := tableRow.row[columnName].(string)
+	if !ok {
+		return ""
+	}
+
+	return value
+}
+
+func (tableRow *TableRow) ColumnValueInt(columnName string) int {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return int(value)
+}
+
+func (tableRow *TableRow) ColumnValueInt8(columnName string) int8 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return int8(value)
+}
+
+func (tableRow *TableRow) ColumnValueInt16(columnName string) int16 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return int16(value)
+}
+
+func (tableRow *TableRow) ColumnValueInt32(columnName string) int32 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return int32(value)
+}
+
+func (tableRow *TableRow) ColumnValueInt64(columnName string) int64 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return int64(value)
+}
+
+func (tableRow *TableRow) ColumnValueUint(columnName string) uint {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return uint(value)
+}
+
+func (tableRow *TableRow) ColumnValueUint8(columnName string) uint8 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return uint8(value)
+}
+
+func (tableRow *TableRow) ColumnValueUint16(columnName string) uint16 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return uint16(value)
+}
+
+func (tableRow *TableRow) ColumnValueUint32(columnName string) uint32 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return uint32(value)
+}
+
+func (tableRow *TableRow) ColumnValueUint64(columnName string) uint64 {
+	value, ok := tableRow.row[columnName].(uint64)
+	if !ok {
+		return 0
+	}
+
+	return value
+}
+
+func (tableRow *TableRow) ColumnValueFloat32(columnName string) float32 {
+	value, ok := tableRow.row[columnName].(float64)
+	if !ok {
+		return 0
+	}
+
+	return float32(value)
+}
+
+func (tableRow *TableRow) ColumnValueFloat64(columnName string) float64 {
+	value, ok := tableRow.row[columnName].(float64)
+	if !ok {
+		return 0
+	}
+
+	return value
+}
+
+func (tableRow *TableRow) ToDPSTableRow() (*request.TableRow, error) {
+	if tableRow.row == nil || len(tableRow.row) == 0 {
+		return &request.TableRow{Columns: make([]*request.Column, 0)}, nil
+	}
+
+	columns := make([]*request.Column, 0)
+	for columnName, value := range tableRow.row {
+		valueType := reflect.TypeOf(value)
+
+		typedValue := new(request.ColumnValue)
+		typedValue.Type = valueType.Name()
+
+		switch valueType.Name() {
+		case "Time":
+			timeObj := value.(time.Time)
+			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(timeObj.Unix())}
+		case "string":
+			typedValue.TypedValue = &request.ColumnValue_StringValue{StringValue: value.(string)}
+		case "bool":
+			typedValue.TypedValue = &request.ColumnValue_BoolValue{BoolValue: value.(bool)}
+		case "uint64":
+			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: value.(uint64)}
+		case "float64":
+			typedValue.TypedValue = &request.ColumnValue_Float64Value{Float64Value: value.(float64)}
+		default:
+			return nil, errors.New("不支持的数据类型" + valueType.Name())
+		}
+
+		columns = append(columns, &request.Column{
+			Name:  columnName,
+			Value: typedValue,
+		})
+	}
+
+	return &request.TableRow{Columns: columns}, nil
+}
+
+func (tableRow *TableRow) FromDSPInfoData(infoData *response.InfoData) error {
+	for _, column := range infoData.Columns {
+		typeStr := column.Value.Type
+
+		if typeStr == "Time" {
+			timeObj := time.Unix(int64(column.Value.GetUint64Value()), 0)
+			tableRow.row[column.Name] = timeObj
+		} else if typeStr == "string" {
+			tableRow.row[column.Name] = column.Value.GetStringValue()
+		} else if typeStr == "bool" {
+			tableRow.row[column.Name] = column.Value.GetBoolValue()
+		} else if strings.Contains(typeStr, "int") {
+			tableRow.row[column.Name] = column.Value.GetUint64Value()
+		} else if strings.Contains(typeStr, "float") {
+			tableRow.row[column.Name] = column.Value.GetFloat64Value()
+		} else {
+			return errors.New("不支持的数据类型" + column.Value.Type)
+		}
+	}
+
+	return nil
+}
+
+type TableRows []TableRow
+
+func (tableRows *TableRows) FromDSPInfosData(infosData []*response.InfoData) error {
+	for _, infoData := range infosData {
+		tableRow := NewTableRow()
+		err := tableRow.FromDSPInfoData(infoData)
+		if err != nil {
+			return err
+		}
+
+		*tableRows = append(*tableRows, *tableRow)
+	}
+
+	return nil
+}

+ 35 - 126
dpsv1/client.go

@@ -3,18 +3,13 @@ package dpsv1
 import (
 	"context"
 	"encoding/json"
-	"errors"
 	"git.sxidc.com/service-supports/dps-sdk/client"
 	"git.sxidc.com/service-supports/dps-sdk/pb/v1"
 	"git.sxidc.com/service-supports/dps-sdk/pb/v1/request"
-	"git.sxidc.com/service-supports/dps-sdk/pb/v1/response"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/credentials/insecure"
 	"io"
-	"reflect"
-	"strings"
 	"sync"
-	"time"
 )
 
 type Client struct {
@@ -135,7 +130,11 @@ func (c *Client) Transaction(txFunc client.TransactionFunc) error {
 }
 
 func (c *Client) Insert(req *client.InsertRequest) (string, error) {
-	tableRow, err := c.formTableRow(req.TableRow)
+	if req.TableRow == nil {
+		return "", nil
+	}
+
+	tableRow, err := req.TableRow.ToDPSTableRow()
 	if err != nil {
 		return "", err
 	}
@@ -161,7 +160,11 @@ func (c *Client) InsertBatch(req *client.InsertBatchRequest) (string, error) {
 	for _, reqTableItem := range req.Items {
 		tableRows := make([]*request.TableRow, 0)
 		for _, reqTableRow := range reqTableItem.TableRows {
-			tableRow, err := c.formTableRow(reqTableRow)
+			if reqTableRow == nil {
+				continue
+			}
+
+			tableRow, err := reqTableRow.ToDPSTableRow()
 			if err != nil {
 				return "", err
 			}
@@ -235,7 +238,11 @@ func (c *Client) DeleteBatch(req *client.DeleteBatchRequest) (string, error) {
 }
 
 func (c *Client) Update(req *client.UpdateRequest) (string, error) {
-	newTableRow, err := c.formTableRow(req.NewTableRow)
+	if req.NewTableRow == nil {
+		return "", nil
+	}
+
+	newTableRow, err := req.NewTableRow.ToDPSTableRow()
 	if err != nil {
 		return "", err
 	}
@@ -270,7 +277,7 @@ func (c *Client) Replay(req *client.ReplayRequest) (string, error) {
 	return reply.Statement, nil
 }
 
-func (c *Client) QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, []map[string]any, int64, error) {
+func (c *Client) QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, *client.TableRows, int64, error) {
 	selectJsonBytes, err := json.Marshal(req.Select)
 	if err != nil {
 		return "", nil, 0, err
@@ -295,15 +302,16 @@ func (c *Client) QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByReques
 		return "", nil, 0, err
 	}
 
-	infosMap, err := c.infoDataToInfoMapBatch(reply.Infos)
+	tableRows := new(client.TableRows)
+	err = tableRows.FromDSPInfosData(reply.Infos)
 	if err != nil {
 		return "", nil, 0, err
 	}
 
-	return reply.Statement, infosMap, reply.TotalCount, nil
+	return reply.Statement, tableRows, reply.TotalCount, nil
 }
 
-func (c *Client) CommonQuery(req *client.CommonQueryRequest) (string, []map[string]any, int64, error) {
+func (c *Client) CommonQuery(req *client.CommonQueryRequest) (string, *client.TableRows, int64, error) {
 	selectJsonBytes, err := json.Marshal(req.Select)
 	if err != nil {
 		return "", nil, 0, err
@@ -347,15 +355,16 @@ func (c *Client) CommonQuery(req *client.CommonQueryRequest) (string, []map[stri
 		return "", nil, 0, err
 	}
 
-	infosMap, err := c.infoDataToInfoMapBatch(reply.Infos)
+	tableRows := new(client.TableRows)
+	err = tableRows.FromDSPInfosData(reply.Infos)
 	if err != nil {
 		return "", nil, 0, err
 	}
 
-	return reply.Statement, infosMap, reply.TotalCount, nil
+	return reply.Statement, tableRows, reply.TotalCount, nil
 }
 
-func (c *Client) QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, []map[string]any, error) {
+func (c *Client) QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, *client.TableRows, error) {
 	selectJsonBytes, err := json.Marshal(req.Select)
 	if err != nil {
 		return "", nil, err
@@ -380,15 +389,16 @@ func (c *Client) QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRe
 		return "", nil, err
 	}
 
-	infosMap, err := c.infoDataToInfoMapBatch(reply.Infos)
+	tableRows := new(client.TableRows)
+	err = tableRows.FromDSPInfosData(reply.Infos)
 	if err != nil {
 		return "", nil, err
 	}
 
-	return reply.Statement, infosMap, nil
+	return reply.Statement, tableRows, nil
 }
 
-func (c *Client) CommonQueryOnly(req *client.CommonQueryRequest) (string, []map[string]any, error) {
+func (c *Client) CommonQueryOnly(req *client.CommonQueryRequest) (string, *client.TableRows, error) {
 	selectJsonBytes, err := json.Marshal(req.Select)
 	if err != nil {
 		return "", nil, err
@@ -432,15 +442,16 @@ func (c *Client) CommonQueryOnly(req *client.CommonQueryRequest) (string, []map[
 		return "", nil, err
 	}
 
-	infosMap, err := c.infoDataToInfoMapBatch(reply.Infos)
+	tableRows := new(client.TableRows)
+	err = tableRows.FromDSPInfosData(reply.Infos)
 	if err != nil {
 		return "", nil, err
 	}
 
-	return reply.Statement, infosMap, nil
+	return reply.Statement, tableRows, nil
 }
 
-func (c *Client) QueryByKeys(req *client.QueryByKeysRequest) (string, map[string]any, error) {
+func (c *Client) QueryByKeys(req *client.QueryByKeysRequest) (string, *client.TableRow, error) {
 	selectJsonBytes, err := json.Marshal(req.Select)
 	if err != nil {
 		return "", nil, err
@@ -457,12 +468,13 @@ func (c *Client) QueryByKeys(req *client.QueryByKeysRequest) (string, map[string
 		return "", nil, err
 	}
 
-	infoMap, err := c.infoDataToInfoMap(reply.Info)
+	tableRow := client.NewTableRow()
+	err = tableRow.FromDSPInfoData(reply.Info)
 	if err != nil {
 		return "", nil, err
 	}
 
-	return reply.Statement, infoMap, nil
+	return reply.Statement, tableRow, nil
 }
 
 func (c *Client) CountWhere(req *client.CountWhereRequest) (string, int64, error) {
@@ -771,106 +783,3 @@ func (c *Client) CommonCountEventHistory(req *client.CommonCountEventRequest) (s
 
 	return reply.Statement, reply.Count, nil
 }
-
-func (c *Client) formTableRow(tableRow map[string]any) (*request.TableRow, error) {
-	if tableRow == nil || len(tableRow) == 0 {
-		return &request.TableRow{Columns: make([]*request.Column, 0)}, nil
-	}
-
-	columns := make([]*request.Column, 0)
-	for columnName, value := range tableRow {
-		valueType := reflect.TypeOf(value)
-		if valueType.Kind() == reflect.Ptr {
-			reflectValue := reflect.ValueOf(value).Elem()
-			valueType = reflectValue.Type()
-			value = reflectValue.Interface()
-		}
-
-		typedValue := new(request.ColumnValue)
-		typedValue.Kind = int32(valueType.Kind())
-		typedValue.Type = valueType.Name()
-
-		switch valueType.Name() {
-		case "Time":
-			timeObj := value.(time.Time)
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(timeObj.Unix())}
-		case "string":
-			typedValue.TypedValue = &request.ColumnValue_StringValue{StringValue: value.(string)}
-		case "bool":
-			typedValue.TypedValue = &request.ColumnValue_BoolValue{BoolValue: value.(bool)}
-		case "int":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(int))}
-		case "int8":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(int8))}
-		case "int16":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(int16))}
-		case "int32":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(int32))}
-		case "int64":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(int64))}
-		case "uint":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(uint))}
-		case "uint8":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(uint8))}
-		case "uint16":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(uint16))}
-		case "uint32":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: uint64(value.(uint32))}
-		case "uint64":
-			typedValue.TypedValue = &request.ColumnValue_Uint64Value{Uint64Value: value.(uint64)}
-		case "float32":
-			typedValue.TypedValue = &request.ColumnValue_Float64Value{Float64Value: float64(value.(float32))}
-		case "float64":
-			typedValue.TypedValue = &request.ColumnValue_Float64Value{Float64Value: value.(float64)}
-		default:
-			return nil, errors.New("不支持的数据类型" + valueType.Name())
-		}
-
-		columns = append(columns, &request.Column{
-			Name:  columnName,
-			Value: typedValue,
-		})
-	}
-
-	return &request.TableRow{Columns: columns}, nil
-}
-
-func (c *Client) infoDataToInfoMap(infoData *response.InfoData) (map[string]any, error) {
-	retInfoMap := make(map[string]any)
-
-	for _, column := range infoData.Columns {
-		typeStr := column.Value.Type
-
-		if typeStr == "Time" {
-			timeObj := time.Unix(int64(column.Value.GetUint64Value()), 0)
-			retInfoMap[column.Name] = timeObj
-		} else if typeStr == "string" {
-			retInfoMap[column.Name] = column.Value.GetStringValue()
-		} else if typeStr == "bool" {
-			retInfoMap[column.Name] = column.Value.GetBoolValue()
-		} else if strings.Contains(typeStr, "int") {
-			retInfoMap[column.Name] = column.Value.GetUint64Value()
-		} else if strings.Contains(typeStr, "float") {
-			retInfoMap[column.Name] = column.Value.GetFloat64Value()
-		} else {
-			return nil, errors.New("不支持的数据类型" + column.Value.Type)
-		}
-	}
-
-	return retInfoMap, nil
-}
-
-func (c *Client) infoDataToInfoMapBatch(infosData []*response.InfoData) ([]map[string]any, error) {
-	retInfosDataMap := make([]map[string]any, 0)
-
-	for _, infoData := range infosData {
-		retInfoMap, err := c.infoDataToInfoMap(infoData)
-		if err != nil {
-			return nil, err
-		}
-
-		retInfosDataMap = append(retInfosDataMap, retInfoMap)
-	}
-
-	return retInfosDataMap, nil
-}

+ 15 - 3
dpsv1/transaction.go

@@ -12,6 +12,10 @@ type Transaction struct {
 }
 
 func (tx *Transaction) InsertTx(req *client.InsertRequest) (string, error) {
+	if req.TableRow == nil {
+		return "", nil
+	}
+
 	tx.client.transactionMutex.Lock()
 	defer tx.client.transactionMutex.Unlock()
 
@@ -30,7 +34,7 @@ func (tx *Transaction) InsertTx(req *client.InsertRequest) (string, error) {
 		}
 	}()
 
-	reqTableRow, err := tx.client.formTableRow(req.TableRow)
+	reqTableRow, err := req.TableRow.ToDPSTableRow()
 	if err != nil {
 		return "", err
 	}
@@ -81,7 +85,11 @@ func (tx *Transaction) InsertBatchTx(req *client.InsertBatchRequest) (string, er
 	for _, reqTableItem := range req.Items {
 		tableRows := make([]*request.TableRow, 0)
 		for _, reqTableRow := range reqTableItem.TableRows {
-			tableRow, err := tx.client.formTableRow(reqTableRow)
+			if reqTableRow == nil {
+				continue
+			}
+
+			tableRow, err := reqTableRow.ToDPSTableRow()
 			if err != nil {
 				return "", err
 			}
@@ -212,6 +220,10 @@ func (tx *Transaction) DeleteBatchTx(req *client.DeleteBatchRequest) (string, er
 }
 
 func (tx *Transaction) UpdateTx(req *client.UpdateRequest) (string, error) {
+	if req.NewTableRow == nil {
+		return "", nil
+	}
+
 	tx.client.transactionMutex.Lock()
 	defer tx.client.transactionMutex.Unlock()
 
@@ -230,7 +242,7 @@ func (tx *Transaction) UpdateTx(req *client.UpdateRequest) (string, error) {
 		}
 	}()
 
-	reqNewTableRow, err := tx.client.formTableRow(req.NewTableRow)
+	reqNewTableRow, err := req.NewTableRow.ToDPSTableRow()
 	if err != nil {
 		return "", err
 	}

+ 5 - 5
instance_query.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/service-supports/fslog"
 )
 
-func QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) ([]map[string]any, int64, error) {
+func QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (*client.TableRows, int64, error) {
 	statement, dataMaps, totalCount, err := dpsClient.QueryByWhereAndOrderBy(req)
 	if err != nil {
 		return nil, 0, err
@@ -16,7 +16,7 @@ func QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) ([]map[st
 	return dataMaps, totalCount, nil
 }
 
-func CommonQuery(req *client.CommonQueryRequest) ([]map[string]any, int64, error) {
+func CommonQuery(req *client.CommonQueryRequest) (*client.TableRows, int64, error) {
 	statement, dataMaps, totalCount, err := dpsClient.CommonQuery(req)
 	if err != nil {
 		return nil, 0, err
@@ -27,7 +27,7 @@ func CommonQuery(req *client.CommonQueryRequest) ([]map[string]any, int64, error
 	return dataMaps, totalCount, nil
 }
 
-func QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) ([]map[string]any, error) {
+func QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (*client.TableRows, error) {
 	statement, dataMaps, err := dpsClient.QueryOnlyByWhereAndOrderBy(req)
 	if err != nil {
 		return nil, err
@@ -38,7 +38,7 @@ func QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) ([]ma
 	return dataMaps, nil
 }
 
-func CommonQueryOnly(req *client.CommonQueryRequest) ([]map[string]any, error) {
+func CommonQueryOnly(req *client.CommonQueryRequest) (*client.TableRows, error) {
 	statement, dataMaps, err := dpsClient.CommonQueryOnly(req)
 	if err != nil {
 		return nil, err
@@ -49,7 +49,7 @@ func CommonQueryOnly(req *client.CommonQueryRequest) ([]map[string]any, error) {
 	return dataMaps, nil
 }
 
-func QueryByKeys(req *client.QueryByKeysRequest) (map[string]any, error) {
+func QueryByKeys(req *client.QueryByKeysRequest) (*client.TableRow, error) {
 	statement, dataMap, err := dpsClient.QueryByKeys(req)
 	if err != nil {
 		return nil, err

+ 20 - 29
pb/v1/request/command.pb.go

@@ -1460,8 +1460,7 @@ type ColumnValue struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Kind int32  `protobuf:"varint,1,opt,name=Kind,proto3" json:"Kind,omitempty"`
-	Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"`
+	Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
 	// Types that are assignable to TypedValue:
 	//
 	//	*ColumnValue_StringValue
@@ -1503,13 +1502,6 @@ func (*ColumnValue) Descriptor() ([]byte, []int) {
 	return file_v1_request_command_proto_rawDescGZIP(), []int{21}
 }
 
-func (x *ColumnValue) GetKind() int32 {
-	if x != nil {
-		return x.Kind
-	}
-	return 0
-}
-
 func (x *ColumnValue) GetType() string {
 	if x != nil {
 		return x.Type
@@ -1557,19 +1549,19 @@ type isColumnValue_TypedValue interface {
 }
 
 type ColumnValue_StringValue struct {
-	StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3,oneof"`
+	StringValue string `protobuf:"bytes,2,opt,name=StringValue,proto3,oneof"`
 }
 
 type ColumnValue_Uint64Value struct {
-	Uint64Value uint64 `protobuf:"varint,4,opt,name=Uint64Value,proto3,oneof"`
+	Uint64Value uint64 `protobuf:"varint,3,opt,name=Uint64Value,proto3,oneof"`
 }
 
 type ColumnValue_Float64Value struct {
-	Float64Value float64 `protobuf:"fixed64,5,opt,name=Float64Value,proto3,oneof"`
+	Float64Value float64 `protobuf:"fixed64,4,opt,name=Float64Value,proto3,oneof"`
 }
 
 type ColumnValue_BoolValue struct {
-	BoolValue bool `protobuf:"varint,6,opt,name=BoolValue,proto3,oneof"`
+	BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3,oneof"`
 }
 
 func (*ColumnValue_StringValue) isColumnValue_TypedValue() {}
@@ -1857,22 +1849,21 @@ var file_v1_request_command_proto_rawDesc = []byte{
 	0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18,
 	0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e,
 	0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x22, 0xd1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
-	0x52, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x53, 0x74,
-	0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48,
-	0x00, 0x52, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x22,
-	0x0a, 0x0b, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20,
-	0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x12, 0x24, 0x0a, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x46, 0x6c, 0x6f, 0x61,
-	0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x6c,
-	0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x42,
-	0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65,
-	0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x20, 0x5a, 0x1e, 0x64, 0x70, 0x73, 0x2f, 0x61, 0x70,
-	0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31,
-	0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x75, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c,
+	0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
+	0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x53,
+	0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x55, 0x69,
+	0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48,
+	0x00, 0x52, 0x0b, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x24,
+	0x0a, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04,
+	0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56,
+	0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75,
+	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x42, 0x6f, 0x6f, 0x6c, 0x56,
+	0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x64, 0x56, 0x61, 0x6c,
+	0x75, 0x65, 0x42, 0x20, 0x5a, 0x1e, 0x64, 0x70, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72,
+	0x70, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 20 - 29
pb/v1/response/query.pb.go

@@ -371,8 +371,7 @@ type ColumnValue struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Kind int32  `protobuf:"varint,1,opt,name=Kind,proto3" json:"Kind,omitempty"`
-	Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"`
+	Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
 	// Types that are assignable to TypedValue:
 	//
 	//	*ColumnValue_StringValue
@@ -414,13 +413,6 @@ func (*ColumnValue) Descriptor() ([]byte, []int) {
 	return file_v1_response_query_proto_rawDescGZIP(), []int{6}
 }
 
-func (x *ColumnValue) GetKind() int32 {
-	if x != nil {
-		return x.Kind
-	}
-	return 0
-}
-
 func (x *ColumnValue) GetType() string {
 	if x != nil {
 		return x.Type
@@ -468,19 +460,19 @@ type isColumnValue_TypedValue interface {
 }
 
 type ColumnValue_StringValue struct {
-	StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3,oneof"`
+	StringValue string `protobuf:"bytes,2,opt,name=StringValue,proto3,oneof"`
 }
 
 type ColumnValue_Uint64Value struct {
-	Uint64Value uint64 `protobuf:"varint,4,opt,name=Uint64Value,proto3,oneof"`
+	Uint64Value uint64 `protobuf:"varint,3,opt,name=Uint64Value,proto3,oneof"`
 }
 
 type ColumnValue_Float64Value struct {
-	Float64Value float64 `protobuf:"fixed64,5,opt,name=Float64Value,proto3,oneof"`
+	Float64Value float64 `protobuf:"fixed64,4,opt,name=Float64Value,proto3,oneof"`
 }
 
 type ColumnValue_BoolValue struct {
-	BoolValue bool `protobuf:"varint,6,opt,name=BoolValue,proto3,oneof"`
+	BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3,oneof"`
 }
 
 func (*ColumnValue_StringValue) isColumnValue_TypedValue() {}
@@ -531,22 +523,21 @@ var file_v1_response_query_proto_rawDesc = []byte{
 	0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
 	0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6c,
 	0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22,
-	0xd1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
-	0x12, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x4b,
-	0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e,
-	0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b,
-	0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x55,
-	0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04,
-	0x48, 0x00, 0x52, 0x0b, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
-	0x24, 0x0a, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18,
-	0x05, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34,
-	0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x42, 0x6f, 0x6f, 0x6c,
-	0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x64, 0x56, 0x61,
-	0x6c, 0x75, 0x65, 0x42, 0x21, 0x5a, 0x1f, 0x64, 0x70, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
-	0x72, 0x70, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65,
-	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0xbd, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
+	0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54,
+	0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c,
+	0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x53, 0x74, 0x72, 0x69,
+	0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x55, 0x69, 0x6e, 0x74, 0x36,
+	0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b,
+	0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x24, 0x0a, 0x0c, 0x46,
+	0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x01, 0x48, 0x00, 0x52, 0x0c, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75,
+	0x65, 0x12, 0x1e, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75,
+	0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42,
+	0x21, 0x5a, 0x1f, 0x64, 0x70, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f,
+	0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+	0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 20 - 25
test/v1/sdk.go

@@ -120,17 +120,16 @@ func (toolKit *ToolKit) reply(req *client.ReplayRequest) *ToolKit {
 	return toolKit
 }
 
-func (toolKit *ToolKit) queryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest, retInfosMap *[]map[string]any, retTotalCount *int64) *ToolKit {
-	statement, infosMap, totalCount, err := clientInstance.QueryByWhereAndOrderBy(req)
+func (toolKit *ToolKit) queryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest, retTableRows *client.TableRows, retTotalCount *int64) *ToolKit {
+	statement, tableRows, totalCount, err := clientInstance.QueryByWhereAndOrderBy(req)
 	if err != nil {
 		toolKit.t.Fatal(err)
 	}
 
 	fmt.Println(statement)
 
-	if retInfosMap != nil {
-		*retInfosMap = make([]map[string]any, 0)
-		*retInfosMap = infosMap
+	if retTableRows != nil {
+		*retTableRows = *tableRows
 	}
 
 	if retTotalCount != nil {
@@ -140,17 +139,16 @@ func (toolKit *ToolKit) queryByWhereAndOrderBy(req *client.QueryByWhereAndOrderB
 	return toolKit
 }
 
-func (toolKit *ToolKit) commonQuery(req *client.CommonQueryRequest, retInfosMap *[]map[string]any, retTotalCount *int64) *ToolKit {
-	statement, infosMap, totalCount, err := clientInstance.CommonQuery(req)
+func (toolKit *ToolKit) commonQuery(req *client.CommonQueryRequest, retTableRows *client.TableRows, retTotalCount *int64) *ToolKit {
+	statement, tableRows, totalCount, err := clientInstance.CommonQuery(req)
 	if err != nil {
 		toolKit.t.Fatal(err)
 	}
 
 	fmt.Println(statement)
 
-	if retInfosMap != nil {
-		*retInfosMap = make([]map[string]any, 0)
-		*retInfosMap = infosMap
+	if retTableRows != nil {
+		*retTableRows = *tableRows
 	}
 
 	if retTotalCount != nil {
@@ -160,49 +158,46 @@ func (toolKit *ToolKit) commonQuery(req *client.CommonQueryRequest, retInfosMap
 	return toolKit
 }
 
-func (toolKit *ToolKit) queryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest, retInfosMap *[]map[string]any) *ToolKit {
-	statement, infosMap, err := clientInstance.QueryOnlyByWhereAndOrderBy(req)
+func (toolKit *ToolKit) queryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest, retTableRows *client.TableRows) *ToolKit {
+	statement, tableRows, err := clientInstance.QueryOnlyByWhereAndOrderBy(req)
 	if err != nil {
 		toolKit.t.Fatal(err)
 	}
 
 	fmt.Println(statement)
 
-	if retInfosMap != nil {
-		*retInfosMap = make([]map[string]any, 0)
-		*retInfosMap = infosMap
+	if retTableRows != nil {
+		*retTableRows = *tableRows
 	}
 
 	return toolKit
 }
 
-func (toolKit *ToolKit) commonQueryOnly(req *client.CommonQueryRequest, retInfosMap *[]map[string]any) *ToolKit {
-	statement, infosMap, err := clientInstance.CommonQueryOnly(req)
+func (toolKit *ToolKit) commonQueryOnly(req *client.CommonQueryRequest, retTableRows *client.TableRows) *ToolKit {
+	statement, tableRows, err := clientInstance.CommonQueryOnly(req)
 	if err != nil {
 		toolKit.t.Fatal(err)
 	}
 
 	fmt.Println(statement)
 
-	if retInfosMap != nil {
-		*retInfosMap = make([]map[string]any, 0)
-		*retInfosMap = infosMap
+	if retTableRows != nil {
+		*retTableRows = *tableRows
 	}
 
 	return toolKit
 }
 
-func (toolKit *ToolKit) queryByKeys(req *client.QueryByKeysRequest, retInfoMap *map[string]any) *ToolKit {
-	statement, infoMap, err := clientInstance.QueryByKeys(req)
+func (toolKit *ToolKit) queryByKeys(req *client.QueryByKeysRequest, retTableRow *client.TableRow) *ToolKit {
+	statement, tableRow, err := clientInstance.QueryByKeys(req)
 	if err != nil {
 		toolKit.t.Fatal(err)
 	}
 
 	fmt.Println(statement)
 
-	if retInfoMap != nil {
-		*retInfoMap = make(map[string]any)
-		*retInfoMap = infoMap
+	if retTableRow != nil {
+		*retTableRow = *tableRow
 	}
 
 	return toolKit

+ 144 - 160
test/v1/v1_test.go

@@ -56,7 +56,7 @@ func TestTransaction(t *testing.T) {
 	newTableNum := rand.New(rand.NewSource(now.Unix())).Intn(10)
 
 	var count int64
-	resultMap := make(map[string]any)
+	resultTableRow := client.NewTableRow()
 
 	newToolKit(t).
 		autoMigrate(&client.AutoMigrateRequest{
@@ -73,12 +73,11 @@ func TestTransaction(t *testing.T) {
 				TablePrefixWithSchema: tablePrefix,
 				Version:               "v1",
 				KeyColumns:            []string{"id"},
-				TableRow: map[string]any{
-					"id":        id,
-					"name":      name,
-					"time":      now,
-					"table_num": tableNum,
-				},
+				TableRow: client.NewTableRow().
+					AddColumnValueString("id", id).
+					AddColumnValueString("name", name).
+					AddColumnValueTime("time", now).
+					AddColumnValueInt("table_num", tableNum),
 				UserID: "test",
 			})
 			if err != nil {
@@ -93,22 +92,21 @@ func TestTransaction(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-		}, &resultMap).
-		assertEqual(id, resultMap["id"], "ID不一致").
-		assertEqual(name, resultMap["name"], "名称不一致").
-		assertEqual(now.Unix(), resultMap["time"].(time.Time).Unix(), "时间不一致").
-		assertEqual(uint64(tableNum), resultMap["table_num"], "表数量不一致").
+		}, resultTableRow).
+		assertEqual(id, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(name, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(now.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum, resultTableRow.ColumnValueInt("table_num"), "表数量不一致").
 		transaction(func(tx client.Transaction) error {
 			statement, err := tx.UpdateTx(&client.UpdateRequest{
 				TablePrefixWithSchema: tablePrefix,
 				Version:               "v1",
 				KeyValues:             map[string]string{"id": id},
-				NewTableRow: map[string]any{
-					"id":        id,
-					"name":      newName,
-					"time":      newNow,
-					"table_num": newTableNum,
-				},
+				NewTableRow: client.NewTableRow().
+					AddColumnValueString("id", id).
+					AddColumnValueString("name", newName).
+					AddColumnValueTime("time", newNow).
+					AddColumnValueInt("table_num", newTableNum),
 				UserID: "test",
 			})
 			if err != nil {
@@ -123,22 +121,21 @@ func TestTransaction(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-		}, &resultMap).
-		assertEqual(id, resultMap["id"], "ID不一致").
-		assertEqual(newName, resultMap["name"], "名称不一致").
-		assertEqual(newNow.Unix(), resultMap["time"].(time.Time).Unix(), "时间不一致").
-		assertEqual(uint64(newTableNum), resultMap["table_num"], "表数量不一致").
+		}, resultTableRow).
+		assertEqual(id, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(newName, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(newNow.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(newTableNum, resultTableRow.ColumnValueInt("table_num"), "表数量不一致").
 		transaction(func(tx client.Transaction) error {
 			statement, err := tx.UpdateTx(&client.UpdateRequest{
 				TablePrefixWithSchema: tablePrefix,
 				Version:               "v1",
 				KeyValues:             map[string]string{"id": id},
-				NewTableRow: map[string]any{
-					"id":        id,
-					"name":      name,
-					"time":      now,
-					"table_num": tableNum,
-				},
+				NewTableRow: client.NewTableRow().
+					AddColumnValueString("id", id).
+					AddColumnValueString("name", name).
+					AddColumnValueTime("time", now).
+					AddColumnValueInt("table_num", tableNum),
 				UserID: "test",
 			})
 			if err != nil {
@@ -188,7 +185,7 @@ func TestTransactionBatch(t *testing.T) {
 	tableNum2 := rand.New(rand.NewSource(now2.Unix())).Intn(10)
 
 	var count int64
-	resultMap := make(map[string]any)
+	resultTableRow := client.NewTableRow()
 
 	newToolKit(t).
 		autoMigrate(&client.AutoMigrateRequest{
@@ -207,19 +204,17 @@ func TestTransactionBatch(t *testing.T) {
 						TablePrefixWithSchema: tablePrefix,
 						Version:               "v1",
 						KeyColumns:            []string{"id"},
-						TableRows: []map[string]any{
-							{
-								"id":        id1,
-								"name":      name1,
-								"time":      now1,
-								"table_num": tableNum1,
-							},
-							{
-								"id":        id2,
-								"name":      name2,
-								"time":      now2,
-								"table_num": tableNum2,
-							},
+						TableRows: []*client.TableRow{
+							client.NewTableRow().
+								AddColumnValueString("id", id1).
+								AddColumnValueString("name", name1).
+								AddColumnValueTime("time", now1).
+								AddColumnValueInt("table_num", tableNum1),
+							client.NewTableRow().
+								AddColumnValueString("id", id2).
+								AddColumnValueString("name", name2).
+								AddColumnValueTime("time", now2).
+								AddColumnValueInt("table_num", tableNum2),
 						},
 					},
 				},
@@ -236,20 +231,20 @@ func TestTransactionBatch(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id1},
-		}, &resultMap).
-		assertEqual(id1, resultMap["id"], "ID不一致").
-		assertEqual(name1, resultMap["name"], "名称不一致").
-		assertEqual(now1.Unix(), resultMap["time"].(time.Time).Unix(), "时间不一致").
-		assertEqual(uint64(tableNum1), resultMap["table_num"], "表数量不一致").
+		}, resultTableRow).
+		assertEqual(id1, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(name1, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(now1.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum1, resultTableRow.ColumnValueInt("table_num"), "表数量不一致").
 		queryByKeys(&client.QueryByKeysRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id2},
-		}, &resultMap).
-		assertEqual(id2, resultMap["id"], "ID不一致").
-		assertEqual(name2, resultMap["name"], "名称不一致").
-		assertEqual(now2.Unix(), resultMap["time"].(time.Time).Unix(), "时间不一致").
-		assertEqual(uint64(tableNum2), resultMap["table_num"], "表数量不一致").
+		}, resultTableRow).
+		assertEqual(id2, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(name2, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(now2.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum2, resultTableRow.ColumnValueInt("table_num"), "表数量不一致").
 		transaction(func(tx client.Transaction) error {
 			statement, err := tx.DeleteBatchTx(&client.DeleteBatchRequest{
 				Items: []client.DeleteTableRowItem{
@@ -301,7 +296,7 @@ func TestInsert(t *testing.T) {
 	now := time.Now().Local()
 	tableNum := rand.New(rand.NewSource(now.Unix())).Intn(10)
 
-	resultMap := make(map[string]any)
+	resultTableRow := client.NewTableRow()
 
 	newToolKit(t).
 		autoMigrate(&client.AutoMigrateRequest{
@@ -317,23 +312,22 @@ func TestInsert(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyColumns:            []string{"id"},
-			TableRow: map[string]any{
-				"id":        id,
-				"name":      name,
-				"time":      now,
-				"table_num": tableNum,
-			},
+			TableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", name).
+				AddColumnValueTime("time", now).
+				AddColumnValueInt("table_num", tableNum),
 			UserID: "test",
 		}).
 		queryByKeys(&client.QueryByKeysRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-		}, &resultMap).
-		assertEqual(id, resultMap["id"], "ID不一致").
-		assertEqual(name, resultMap["name"], "名称不一致").
-		assertEqual(now.Unix(), resultMap["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum), resultMap["table_num"], "表数量不一致")
+		}, resultTableRow).
+		assertEqual(id, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(name, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(now.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum, resultTableRow.ColumnValueInt("table_num"), "表数量不一致")
 }
 
 func TestInsertBatch(t *testing.T) {
@@ -352,7 +346,7 @@ func TestInsertBatch(t *testing.T) {
 	now2 := time.Now().Local()
 	tableNum2 := rand.New(rand.NewSource(now2.Unix())).Intn(10)
 
-	resultsMap := make([]map[string]any, 0)
+	resultTableRows := new(client.TableRows)
 	var totalCount int64
 
 	newToolKit(t).
@@ -371,19 +365,17 @@ func TestInsertBatch(t *testing.T) {
 					TablePrefixWithSchema: tablePrefix,
 					Version:               "v1",
 					KeyColumns:            []string{"id"},
-					TableRows: []map[string]any{
-						{
-							"id":        id1,
-							"name":      name1,
-							"time":      now1,
-							"table_num": tableNum1,
-						},
-						{
-							"id":        id2,
-							"name":      name2,
-							"time":      now2,
-							"table_num": tableNum2,
-						},
+					TableRows: []*client.TableRow{
+						client.NewTableRow().
+							AddColumnValueString("id", id1).
+							AddColumnValueString("name", name1).
+							AddColumnValueTime("time", now1).
+							AddColumnValueInt("table_num", tableNum1),
+						client.NewTableRow().
+							AddColumnValueString("id", id2).
+							AddColumnValueString("name", name2).
+							AddColumnValueTime("time", now2).
+							AddColumnValueInt("table_num", tableNum2),
 					},
 				},
 			},
@@ -396,12 +388,12 @@ func TestInsertBatch(t *testing.T) {
 			},
 			PageNo:   1,
 			PageSize: 1,
-		}, &resultsMap, &totalCount).
+		}, resultTableRows, &totalCount).
 		assertEqual(1, int(totalCount), "总数不一致").
-		assertEqual(id1, resultsMap[0]["id"], "ID不一致").
-		assertEqual(name1, resultsMap[0]["name"], "名称不一致").
-		assertEqual(now1.Unix(), resultsMap[0]["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum1), resultsMap[0]["table_num"], "表数量不一致").
+		assertEqual(id1, (*resultTableRows)[0].ColumnValueString("id"), "ID不一致").
+		assertEqual(name1, (*resultTableRows)[0].ColumnValueString("name"), "名称不一致").
+		assertEqual(now1.Unix(), (*resultTableRows)[0].ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum1, (*resultTableRows)[0].ColumnValueInt("table_num"), "表数量不一致").
 		commonQuery(&client.CommonQueryRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
@@ -410,12 +402,12 @@ func TestInsertBatch(t *testing.T) {
 			},
 			PageNo:   1,
 			PageSize: 1,
-		}, &resultsMap, &totalCount).
+		}, resultTableRows, &totalCount).
 		assertEqual(1, int(totalCount), "总数不一致").
-		assertEqual(id2, resultsMap[0]["id"], "ID不一致").
-		assertEqual(name2, resultsMap[0]["name"], "名称不一致").
-		assertEqual(now2.Unix(), resultsMap[0]["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum2), resultsMap[0]["table_num"], "表数量不一致").
+		assertEqual(id2, (*resultTableRows)[0].ColumnValueString("id"), "ID不一致").
+		assertEqual(name2, (*resultTableRows)[0].ColumnValueString("name"), "名称不一致").
+		assertEqual(now2.Unix(), (*resultTableRows)[0].ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum2, (*resultTableRows)[0].ColumnValueInt("table_num"), "表数量不一致").
 		queryOnlyByWhereAndOrderBy(&client.QueryByWhereAndOrderByRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
@@ -424,11 +416,11 @@ func TestInsertBatch(t *testing.T) {
 			},
 			PageNo:   1,
 			PageSize: 1,
-		}, &resultsMap).
-		assertEqual(id1, resultsMap[0]["id"], "ID不一致").
-		assertEqual(name1, resultsMap[0]["name"], "名称不一致").
-		assertEqual(now1.Unix(), resultsMap[0]["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum1), resultsMap[0]["table_num"], "表数量不一致").
+		}, resultTableRows).
+		assertEqual(id1, (*resultTableRows)[0].ColumnValueString("id"), "ID不一致").
+		assertEqual(name1, (*resultTableRows)[0].ColumnValueString("name"), "名称不一致").
+		assertEqual(now1.Unix(), (*resultTableRows)[0].ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum1, (*resultTableRows)[0].ColumnValueInt("table_num"), "表数量不一致").
 		commonQueryOnly(&client.CommonQueryRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
@@ -437,11 +429,11 @@ func TestInsertBatch(t *testing.T) {
 			},
 			PageNo:   1,
 			PageSize: 1,
-		}, &resultsMap).
-		assertEqual(id2, resultsMap[0]["id"], "ID不一致").
-		assertEqual(name2, resultsMap[0]["name"], "名称不一致").
-		assertEqual(now2.Unix(), resultsMap[0]["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum2), resultsMap[0]["table_num"], "表数量不一致")
+		}, resultTableRows).
+		assertEqual(id2, (*resultTableRows)[0].ColumnValueString("id"), "ID不一致").
+		assertEqual(name2, (*resultTableRows)[0].ColumnValueString("name"), "名称不一致").
+		assertEqual(now2.Unix(), (*resultTableRows)[0].ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum2, (*resultTableRows)[0].ColumnValueInt("table_num"), "表数量不一致")
 }
 
 func TestUpdate(t *testing.T) {
@@ -458,7 +450,7 @@ func TestUpdate(t *testing.T) {
 	newNow := time.Now().Local()
 	newTableNum := rand.New(rand.NewSource(now.Unix())).Intn(10)
 
-	resultMap := make(map[string]any)
+	resultTableRow := client.NewTableRow()
 
 	newToolKit(t).
 		autoMigrate(&client.AutoMigrateRequest{
@@ -474,35 +466,33 @@ func TestUpdate(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyColumns:            []string{"id"},
-			TableRow: map[string]any{
-				"id":        id,
-				"name":      name,
-				"time":      now,
-				"table_num": tableNum,
-			},
+			TableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", name).
+				AddColumnValueTime("time", now).
+				AddColumnValueInt("table_num", tableNum),
 			UserID: "test",
 		}).
 		update(&client.UpdateRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-			NewTableRow: map[string]any{
-				"id":        id,
-				"name":      newName,
-				"time":      newNow,
-				"table_num": newTableNum,
-			},
+			NewTableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", newName).
+				AddColumnValueTime("time", newNow).
+				AddColumnValueInt("table_num", newTableNum),
 			UserID: "test",
 		}).
 		queryByKeys(&client.QueryByKeysRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-		}, &resultMap).
-		assertEqual(id, resultMap["id"], "ID不一致").
-		assertEqual(newName, resultMap["name"], "名称不一致").
-		assertEqual(newNow.Unix(), resultMap["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(newTableNum), resultMap["table_num"], "表数量不一致")
+		}, resultTableRow).
+		assertEqual(id, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(newName, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(newNow.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(newTableNum, resultTableRow.ColumnValueInt("table_num"), "表数量不一致")
 }
 
 func TestDelete(t *testing.T) {
@@ -532,12 +522,11 @@ func TestDelete(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyColumns:            []string{"id"},
-			TableRow: map[string]any{
-				"id":        id,
-				"name":      name,
-				"time":      now,
-				"table_num": tableNum,
-			},
+			TableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", name).
+				AddColumnValueTime("time", now).
+				AddColumnValueInt("table_num", tableNum),
 			UserID: "test",
 		}).
 		delete(&client.DeleteRequest{
@@ -590,19 +579,17 @@ func TestDeleteBatch(t *testing.T) {
 					TablePrefixWithSchema: tablePrefix,
 					Version:               "v1",
 					KeyColumns:            []string{"id"},
-					TableRows: []map[string]any{
-						{
-							"id":        id1,
-							"name":      name1,
-							"time":      now1,
-							"table_num": tableNum1,
-						},
-						{
-							"id":        id2,
-							"name":      name2,
-							"time":      now2,
-							"table_num": tableNum2,
-						},
+					TableRows: []*client.TableRow{
+						client.NewTableRow().
+							AddColumnValueString("id", id1).
+							AddColumnValueString("name", name1).
+							AddColumnValueTime("time", now1).
+							AddColumnValueInt("table_num", tableNum1),
+						client.NewTableRow().
+							AddColumnValueString("id", id2).
+							AddColumnValueString("name", name2).
+							AddColumnValueTime("time", now2).
+							AddColumnValueInt("table_num", tableNum2),
 					},
 				},
 			},
@@ -638,7 +625,7 @@ func TestReply(t *testing.T) {
 	now := time.Now().Local()
 	tableNum := rand.New(rand.NewSource(now.Unix())).Intn(10)
 
-	resultMap := make(map[string]any)
+	resultTableRow := client.NewTableRow()
 
 	newToolKit(t).
 		autoMigrate(&client.AutoMigrateRequest{
@@ -654,12 +641,11 @@ func TestReply(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyColumns:            []string{"id"},
-			TableRow: map[string]any{
-				"id":        id,
-				"name":      name,
-				"time":      now,
-				"table_num": tableNum,
-			},
+			TableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", name).
+				AddColumnValueTime("time", now).
+				AddColumnValueInt("table_num", tableNum),
 			UserID: "test",
 		}).
 		reply(&client.ReplayRequest{
@@ -672,11 +658,11 @@ func TestReply(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-		}, &resultMap).
-		assertEqual(id, resultMap["id"], "ID不一致").
-		assertEqual(name, resultMap["name"], "名称不一致").
-		assertEqual(now.Unix(), resultMap["time"].(time.Time).Local().Unix(), "时间不一致").
-		assertEqual(uint64(tableNum), resultMap["table_num"], "表数量不一致")
+		}, resultTableRow).
+		assertEqual(id, resultTableRow.ColumnValueString("id"), "ID不一致").
+		assertEqual(name, resultTableRow.ColumnValueString("name"), "名称不一致").
+		assertEqual(now.Unix(), resultTableRow.ColumnValueTime("time").Unix(), "时间不一致").
+		assertEqual(tableNum, resultTableRow.ColumnValueInt("table_num"), "表数量不一致")
 }
 
 func TestEventQuery(t *testing.T) {
@@ -710,24 +696,22 @@ func TestEventQuery(t *testing.T) {
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyColumns:            []string{"id"},
-			TableRow: map[string]any{
-				"id":        id,
-				"name":      name,
-				"time":      now,
-				"table_num": tableNum,
-			},
+			TableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", name).
+				AddColumnValueTime("time", now).
+				AddColumnValueInt("table_num", tableNum),
 			UserID: "test",
 		}).
 		update(&client.UpdateRequest{
 			TablePrefixWithSchema: tablePrefix,
 			Version:               "v1",
 			KeyValues:             map[string]string{"id": id},
-			NewTableRow: map[string]any{
-				"id":        id,
-				"name":      newName,
-				"time":      newNow,
-				"table_num": newTableNum,
-			},
+			NewTableRow: client.NewTableRow().
+				AddColumnValueString("id", id).
+				AddColumnValueString("name", newName).
+				AddColumnValueTime("time", newNow).
+				AddColumnValueInt("table_num", newTableNum),
 			UserID: "test",
 		}).
 		countEventByKeys(&client.CountEventByKeysRequest{