(ctx context.Context, session *Session)
| 1024 | } |
| 1025 | |
| 1026 | func (s *BeginRwStatement) Execute(ctx context.Context, session *Session) (*Result, error) { |
| 1027 | if session.InReadWriteTransaction() { |
| 1028 | return nil, errors.New("you're in read-write transaction. Please finish the transaction by 'COMMIT;' or 'ROLLBACK;'") |
| 1029 | } |
| 1030 | if session.InReadOnlyTransaction() { |
| 1031 | return nil, errors.New("you're in read-only transaction. Please finish the transaction by 'CLOSE;'") |
| 1032 | } |
| 1033 | |
| 1034 | if err := session.BeginReadWriteTransaction(ctx, s.IsolationLevel, s.Priority, s.Tag); err != nil { |
| 1035 | return nil, err |
| 1036 | } |
| 1037 | |
| 1038 | return &Result{IsMutation: true}, nil |
| 1039 | } |
| 1040 | |
| 1041 | type CommitStatement struct{} |
| 1042 |
no test coverage detected