Skip to content

A simple resource management utility for working with node-oracledb.

Notifications You must be signed in to change notification settings

jrop/oracledb-with

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oracledb-with

A simple resource management utility for working with node-oracledb.

Installation

npm install --save oracledb-with
# or
yarn add oracledb-with

Usage

Hint: view the API documentation.

import witho from 'oracle-with'

//
// Connections will automatically be cleaned up (closed) for you
//
await witho.conn({connectString: '...', ...}, async conn => {
  await conn.execute(...)
})

//
// ResultSets are automatically cleaned up as well:
//
witho.resultSet(conn, 'SELECT * FROM ...', [], {outFormat: oracledb.OBJECT}, async (resultSet, results) => {
  await resultSet.getRow()
  // use: results.metaData
})

//
// ...or if you already have a connection created with oracledb-with:
//
await witho.conn({connectString: '...', ...}, async conn => {
  await conn.resultSet(sql, bind, opts, async resultSet => {
    // ...
  })
})

//
// Easy selects:
//
witho.select(conn, 'SELECT * FROM ...')
// => Promise<OracleResult {
//      ...
//      metaData: ...,
//      rows: [...],
//      ...
//    }>

//
// Or:
//
await witho.conn({connectString: '...', ...}, async conn => {
  await conn.select(sql, bind, opts, async results => {
    // ...
  })
})

About

A simple resource management utility for working with node-oracledb.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published