Idris2Doc : Oracle.Connection

Oracle.Connection

(source)

Definitions

connect : ConnectInfo->IO (EitherOracleErrorConnection)
  Establish a connection to Oracle.

Visibility: export
disconnect : Connection->IO ()
  Close an Oracle connection.

Visibility: export
withConnection : ConnectInfo-> (Connection->IO (EitherOracleErrora)) ->IO (EitherOracleErrora)
  Establish a connection, execute an action, and guarantee that the connection is closed afterwards.

This function provides safe resource management for Oracle connections, and should generally be preferred over calling `connect` and `disconnect` manually.

The connection is:
1. Established.
2. Passed to the supplied action.
3. Disconnected regardless of whether the action succeeds or fails.

Example:

```idris
withConnection cfg $ \conn =>
query_ conn
"select * from employees"
[]
```

Visibility: export