Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thiagodp/database-js-mssql

Database-js driver for SQL Server that works on Linux, Mac, and Windows
https://github.com/thiagodp/database-js-mssql

database database-js database-js-mssql driver ms-sql ms-sql-server mssql node query sql sql-server tds wrapper

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# database-js-mssql

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

This [database-js](https://github.com/mlaanderson/database-js) driver is a wrapper for [node-mssql](https://github.com/thiagodp/database-js-mssql.git) and works with MS SQL Server 2000-2017. _Pull Requests are welcome!_

## Install

```bash
npm install --save database-js-mssql
```

## Example

```js
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](LICENSE) © [Thiago Delgado Pinto](https://github.com/thiagodp)