Idris2Doc : Oracle.Transaction

Oracle.Transaction

(source)

Definitions

commit : Connection->IO (EitherOracleError ())
  Commit the current transaction on a connection.

All changes made since the last commit or rollback become permanent.

Returns:
- Right () on success.
- Left OracleError on failure.

Totality: total
Visibility: export
rollback : Connection->IO (EitherOracleError ())
  Roll back the current transaction on a connection.

All changes made since the last commit or rollback are discarded.

Returns:
- Right () on success.
- Left OracleError on failure.

Totality: total
Visibility: export
withTransaction : Connection->IO (EitherOracleErrora) ->IO (EitherOracleErrora)
  Execute an action inside a transaction.

The transaction behavior is:
- If the action returns Right -> commit is performed.
- If the action returns Left -> rollback is performed.

The original error is preserved if rollback succeeds.

Example:

```idris
withTransaction conn $ do
execute stmt1
execute stmt2
```

Totality: total
Visibility: export