The MSSQL connector enables LoopBack applications to connect to Microsoft SQL Server data sources.
Page Contents
Note: This page was generated from the
loopback-connector-mssql/README.md.
loopback-connector-mssql
loopback-connector-mssql
is the Microsoft SQL Server connector module for loopback-datasource-juggler.
For complete documentation, see [Documentation | SQL Server Connector](http://loopback.io/doc/en/lb2/SQL-Server-connector.html). |
Installation
npm install loopback-connector-mssql --save
Basic use
To use it you need loopback-datasource-juggler
.
-
Setup dependencies in
package.json
:{ ... "dependencies": { "loopback-datasource-juggler": "latest", "loopback-connector-mssql": "latest" }, ... }
-
Use:
var DataSource = require('loopback-datasource-juggler').DataSource; var dataSource = new DataSource('mssql', { host: 'demo.strongloop.com', port: 1433, database: 'mydb', username: 'myuser', password: 'mypass', // You need this if using Microsoft Azure SQL database // options: { encrypt: true } });
Running tests
The tests in this repository are mainly integration tests, meaning you will need to run them using our preconfigured test server.
- Ask a core developer for instructions on how to set up test server credentials on your machine
npm test