Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A simple database abstraction layer
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
README.md
index.js
package.json

README.md

A simple Database Abstraction Layer

To use you must call the setup method with an object containing at least:

{ host:"...", // Database hostname username:"...", // Database username password:"...", // Database password database:"..." // Database database (yo dawg) }

Optionally it may include:

{ port:0, // The database host port, defaults to backend default maxConnections:20, // The number of max connections in the pool, default 20 maxTimeout:10000, // The idle timeout for pool connections, default 10s }

Other options may be available per backend.

Once the setup is complete you can begin queries using:

dal.query(sql, binds, function(error, rows) { ... });

SQL is raw sql with ? supported for bound parameters that are found in the binds array. The binds array is not optional and [] must be passed if there are no binds.

Something went wrong with that request. Please try again.