(ctx context.Context, session *Session)
| 1041 | type CommitStatement struct{} |
| 1042 | |
| 1043 | func (s *CommitStatement) Execute(ctx context.Context, session *Session) (*Result, error) { |
| 1044 | result := &Result{IsMutation: true} |
| 1045 | if session.InReadOnlyTransaction() { |
| 1046 | return nil, errors.New("you're in read-only transaction. Please finish the transaction by 'CLOSE;'") |
| 1047 | } |
| 1048 | if !session.InReadWriteTransaction() { |
| 1049 | return result, nil |
| 1050 | } |
| 1051 | |
| 1052 | resp, err := session.CommitReadWriteTransaction(ctx) |
| 1053 | if err != nil { |
| 1054 | return nil, err |
| 1055 | } |
| 1056 | |
| 1057 | result.Timestamp = resp.CommitTs |
| 1058 | result.CommitStats = resp.CommitStats |
| 1059 | return result, nil |
| 1060 | } |
| 1061 | |
| 1062 | type RollbackStatement struct{} |
| 1063 |
no test coverage detected