Skip to content

trevorlinton/query-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Asyncronous Query

A simple modern query interface over oracle or postgresql database using async or await.

Install

node 7+

$ npm install --save async-query

You'll then need to install your driver:

oracle:

$ npm install --save oracledb

or

postgresql:

$ npm install --save pg-pool pg

Example

Make a query to a database

let driver = require('query-async')
async function go() {
	// driver('oracle|postgresql', 'username', 'password', 'hostname', port, 'database_or_servicename', ssl);
	let query = await driver('oracle','user','pass','host',1521,'db',false)
	let result = await query('select * from table where column = $1', ['param']);
	// result now contains array of objects with column names for properties.
	console.log(result) // [{'column':value}]
}
go().catch((e) => { console.log('error', e); }

Support

  • Update, inserts, deletes, selects
  • Parameterized queries (with $1 $2 $3 etc.)
  • Connection pooling

Not supported

  • Transactions
  • Cursors
  • Streams

About

A simple modern query interface over oracle or postgresql database using async or await.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published