1.2.1 • Published 4 years ago

@pi-team-mn/oracle-event-listener v1.2.1

Weekly downloads
17
License
MIT
Repository
github
Last release
4 years ago

Oracle Event Listener

Execute function on Oracle DB events. Oracle AW is required to use this library!

Example

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

namerequirednotes
ORACLE_CONNECTION_STRINGyesconnection string for the database
ORACLE_USERyesuser to connect to db with
ORACLE_PASSWORDyespassword for the user
1.1.8

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago