|
@@ -15,17 +15,17 @@ type SDK struct {
|
|
|
grpcClient *grpc_client.Client
|
|
|
}
|
|
|
|
|
|
-func (s *SDK) ExecuteRawSql(sql string, values ...any) ([]map[string]any, error) {
|
|
|
+func (s *SDK) ExecuteRawSql(sql string, values ...any) ([]map[string]any, int64, error) {
|
|
|
if strutils.IsStringEmpty(sql) {
|
|
|
- return make([]map[string]any, 0), nil
|
|
|
+ return make([]map[string]any, 0), 0, nil
|
|
|
}
|
|
|
|
|
|
options := s.options
|
|
|
|
|
|
- tableRows, err := s.client.ExecuteRawSql(options.token, options.baseUrl,
|
|
|
+ tableRows, rowsAffected, err := s.client.ExecuteRawSql(options.token, options.baseUrl,
|
|
|
options.namespace, options.dataSource, sql, values...)
|
|
|
if err != nil {
|
|
|
- return nil, err
|
|
|
+ return nil, 0, err
|
|
|
}
|
|
|
|
|
|
results := make([]map[string]any, len(tableRows))
|
|
@@ -33,7 +33,7 @@ func (s *SDK) ExecuteRawSql(sql string, values ...any) ([]map[string]any, error)
|
|
|
results[i] = row
|
|
|
}
|
|
|
|
|
|
- return results, nil
|
|
|
+ return results, rowsAffected, nil
|
|
|
}
|
|
|
|
|
|
func (s *SDK) Transaction(txFunc TxFunc) error {
|