|
@@ -70,17 +70,6 @@ func (tx *Transaction) InsertBatchTx(req *client.InsertBatchRequest) (string, er
|
|
|
return "", nil
|
|
|
}
|
|
|
|
|
|
- var err error
|
|
|
-
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- innerErr := tx.stream.CloseSend()
|
|
|
- if innerErr != nil {
|
|
|
- panic(innerErr)
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
tableRowItems := make([]*request.InsertTableRowItem, 0)
|
|
|
|
|
|
for _, reqTableItem := range req.Items {
|
|
@@ -106,7 +95,7 @@ func (tx *Transaction) InsertBatchTx(req *client.InsertBatchRequest) (string, er
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- err = tx.stream.Send(&request.TransactionOperation{
|
|
|
+ err := tx.stream.Send(&request.TransactionOperation{
|
|
|
Request: &request.TransactionOperation_InsertBatchTxRequest{
|
|
|
InsertBatchTxRequest: &request.InsertBatchTxRequest{
|
|
|
Items: tableRowItems,
|
|
@@ -133,18 +122,7 @@ func (tx *Transaction) DeleteTx(req *client.DeleteRequest) (string, error) {
|
|
|
return "", nil
|
|
|
}
|
|
|
|
|
|
- var err error
|
|
|
-
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- innerErr := tx.stream.CloseSend()
|
|
|
- if innerErr != nil {
|
|
|
- panic(innerErr)
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
- err = tx.stream.Send(&request.TransactionOperation{
|
|
|
+ err := tx.stream.Send(&request.TransactionOperation{
|
|
|
Request: &request.TransactionOperation_DeleteTxRequest{
|
|
|
DeleteTxRequest: &request.DeleteTxRequest{
|
|
|
TablePrefixWithSchema: req.TablePrefixWithSchema,
|
|
@@ -178,17 +156,6 @@ func (tx *Transaction) DeleteWhereTx(req *client.DeleteWhereRequest) (string, er
|
|
|
return "", nil
|
|
|
}
|
|
|
|
|
|
- var err error
|
|
|
-
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- innerErr := tx.stream.CloseSend()
|
|
|
- if innerErr != nil {
|
|
|
- panic(innerErr)
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
whereJsonBytes, err := req.Where.ToJson()
|
|
|
if err != nil {
|
|
|
return "", err
|
|
@@ -228,17 +195,6 @@ func (tx *Transaction) UpdateTx(req *client.UpdateRequest) (string, error) {
|
|
|
return "", nil
|
|
|
}
|
|
|
|
|
|
- var err error
|
|
|
-
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- innerErr := tx.stream.CloseSend()
|
|
|
- if innerErr != nil {
|
|
|
- panic(innerErr)
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
reqNewTableRow, err := req.NewTableRow.ToDPSTableRow()
|
|
|
if err != nil {
|
|
|
return "", err
|
|
@@ -283,17 +239,6 @@ func (tx *Transaction) UpdateWhereTx(req *client.UpdateWhereRequest) (string, er
|
|
|
return "", nil
|
|
|
}
|
|
|
|
|
|
- var err error
|
|
|
-
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- innerErr := tx.stream.CloseSend()
|
|
|
- if innerErr != nil {
|
|
|
- panic(innerErr)
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
whereJsonBytes, err := req.Where.ToJson()
|
|
|
if err != nil {
|
|
|
return "", err
|