Home

Awesome

database-js-mssql

Database-js driver for SQL Server that works on Linux, Mac, and Windows

This database-js driver is a wrapper for node-mssql and works with MS SQL Server 2000-2017. Pull Requests are welcome!

Install

npm install --save database-js-mssql

Example

var Connection = require('database-js').Connection;

(async function() {
    let conn, statement, results;
    try {
        conn = new Connection('mssql:///username:password@localhost/database');
        statement = conn.prepareStatement("SELECT * FROM states WHERE state = ?");
        results = await statement.query("South Dakota");
        console.log(results);
    } catch (reason) {
        console.log(reason);
    } finally {
        if (conn) {
            await conn.close();
        }
    }
})();

License

MIT © Thiago Delgado Pinto