Function
Static Public Summary | ||
public |
async connection(opts: object, fn: function): * |
|
public |
|
|
public |
|
Static Public
public async connection(opts: object, fn: function): * source
import {connection} from 'oracledb-with'
Return:
* |
Example:
import witho from 'oracle-with'
await witho.conn({connectString: '...', ...}, async conn => {
await conn.execute(...)
})
public async resultSet(conn: Connection, sql: string, bind: array | object, opts: object, fn: function): * source
import {resultSet} from 'oracledb-with'
Return:
* |
Example:
import witho from 'oracle-with'
witho.resultSet(conn, 'SELECT * FROM ...', [], {outFormat: oracledb.OBJECT}, async (resultSet, results) => {
await resultSet.getRow()
// use: results.metaData
})
// or use on an existing connection:
await witho.conn({connectString: '...', ...}, async conn => {
await conn.resultSet(sql, bind, opts, async resultSet => {
// ...
})
})
public async select(conn: Connection, sql: string, bind: array | object, opts: object): Results source
import {select} from 'oracledb-with'
Return:
Results | Returns the results returned from |
Example:
witho.select(conn, 'SELECT * FROM ...')
// => Promise<OracleResult {
// ...
// metaData: ...,
// rows: [...],
// ...
// }>