oracledb-with
A simple resource management utility for working with [node-oracledb](https://github.com/oracle/node-oracledb).
Last updated 4 months ago by jrop .
MIT · Original npm · Tarball
$ cnpm install oracledb-with 
SYNC missed versions from official npm registry.

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 => {
    // ...
  })
})
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
  • co ^4.6.0
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |