Skip to content

andrew-barnett/database-js-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

database-js-oracle

Database-js driver for Oracle

database-js-oracle is a wrapper around the oracledb package. It is intended to be used with the database-js package.

Install

npm install database-js-oracle

Usage

const Connection = require('database-js').Connection

(async () => {
    let connection, statement, rows
    connection = new Connection('oracle://my_secret_username:my_secret_password@MY_ORA_SID')

    try {
        statement = await connection.prepareStatement("SELECT SYSDATE FROM DUAL")
        rows = await statement.query()
        console.log(rows)
    } catch (error) {
        console.log(error)
    } finally {
        await connection.close()
    }
})()

Connection URI

The URI used in the Connection constructor has the following format:

oracle://[username[:password]@][connectString][?extraKey=extraValue[&extraKey=extraValue...]]

For connectString, refer to the oracledb documentation.

Refer to database-js-common for how extraKey/extraValue are handled, then refer to the oracledb documentation for what extra parameters and values are supported.

TIP: If connectString format you need isn't handled correctly in the hostname slot of the URI, try putting it in as an extraKey. You'll need a placeholder value in the URI.

License

MIT

About

Database-js driver for Oracle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published