# @pi-team-mn/oracle-event-listener

> Libary to listen to OracleDB events and execute on them

Latest version **1.2.1** (published 2020-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pi-team-mn/oracle-event-listener
pnpm add @pi-team-mn/oracle-event-listener
yarn add @pi-team-mn/oracle-event-listener
bun add @pi-team-mn/oracle-event-listener
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2020-07-14 |
| First published | 2019-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | pi-team@mn.nl [David Diks] |
| Maintainers | alainnaipal, ddq-mn, fbloembergen, kennethmartis |

## Links

- npm: https://www.npmjs.com/package/@pi-team-mn/oracle-event-listener
- Repository: https://github.com/pi-team-mn/oracle-event-listener
- Homepage: https://github.com/pi-team-mn/oracle-event-listener#readme
- Issues: https://github.com/pi-team-mn/oracle-event-listener/issues
- npm.io page: https://npm.io/package/@pi-team-mn/oracle-event-listener

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [oracledb](https://npm.io/package/oracledb.md) ^5.0.0
- [promise-retry](https://npm.io/package/promise-retry.md) ^1.1.1

## Recent versions

- 1.2.1 (latest) — 2020-07-14
- 1.1.8 — 2020-07-14
- 1.2.0 — 2020-06-30
- 1.1.7 — 2019-11-28
- 1.1.6 — 2019-11-27
- 1.1.5 — 2019-11-27
- 1.1.4 — 2019-11-26
- 1.1.3 — 2019-11-26
- 1.1.2 — 2019-11-22
- 1.1.1 — 2019-11-22
- 1.1.0 — 2019-11-20
- 1.0.5 — 2019-10-14
- 1.0.4 — 2019-09-04
- 1.0.3 — 2019-09-04
- 1.0.2 — 2019-08-29
- … 2 more at https://npm.io/package/@pi-team-mn/oracle-event-listener/versions

## README

# Oracle Event Listener

Execute function on Oracle DB events. Oracle AW is required to use this library!

## Example

```typescript
async function main() {
    // The :event in the query is important!
    const query = `begin
                                      :event := event_source_package.dequeue_event_function();
                                   end;`; 

    const oracleConfig = readPoolConfigFromEnv(process.env);
    const pool = await (getConnection(oracleConfig));
    await testConnection(pool);

    let nrConnections = 0;

    while (nrConnections < pool.poolMax) {
        executeOnEvent<IncomingEvent>(pool, query, async item => {
            return await sendToCoda(transform(item));
        }).catch((err: any) => console.error(err));
        nrConnections++;
        console.log(`Awaiting events ... (coroutine ${nrConnections})`);
    }
}

main().catch(err => console.error(err))
```

## Environment variables

name | required | notes
--- | --- | ---
ORACLE_CONNECTION_STRING | yes | connection string for the database
ORACLE_USER | yes | user to connect to db with
ORACLE_PASSWORD | yes | password for the user

---
_Source: https://npm.io/package/@pi-team-mn/oracle-event-listener · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
