Registry / database / loopback-connector-mssql-regevbr

loopback-connector-mssql-regevbr

JSON →
library3.6.2jsnpmunverified

Microsoft SQL Server connector for the LoopBack framework (v3.6.2, last release May 2020). This package integrates MSSQL databases into LoopBack/loopback-datasource-juggler with a defined schema and CRUD operations. It wraps the underlying node-mssql driver and supports connection pooling, encrypted connections for Azure, and standard LB data source configuration. Minimal release cadence, no active development since 2020. Alternatives: loopback-connector-mssql (official StrongLoop version) or use sequelize/mongoose with MSSQL.

npm install loopback-connector-mssql-regevbr
INSTALL
IMPORT
SIG · LOOPBACK-CONNECTOR
L
loopback-connector-mssql-regevbr
databasejavascriptv3.6.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connector
In datasources.json: "connector": "mssql"
"connector": "loopback-connector-mssql"
Both work, but 'mssql' is shorter and preferred in LoopBack 3.
DataSource
import { DataSource } from 'loopback-datasource-juggler'
const DataSource = require('loopback-connector-mssql').DataSource
The connector is not used directly; you create a datasource via loopback-datasource-juggler.
Model
import { Model } from 'loopback'
import { Model } from 'loopback-connector-mssql'
Model is defined in LoopBack core, not the connector.

Configure a LoopBack datasource to use the MSSQL connector.

// datasources.json example { "sqlserverdb": { "name": "sqlserverdb", "connector": "mssql", "host": "localhost", "port": 1433, "database": "mydb", "user": "sa", "password": "your_password" } } // Then in boot script or model config, reference the datasource: // model-config.json { "Customer": { "dataSource": "sqlserverdb", "public": true } }
Debug
Known issues
gotchaFor Azure, you must set 'encrypt: true' in options, otherwise connection fails.
fix
"options": { "encrypt": true }
affects: >=1.0.0
gotchaThe connector does not support connection via 'url' property if you also specify individual connection properties; they may conflict.
fix
Use either 'url' or individual host/port/user/password/database, not both.
affects: >=3.0.0
deprecatedLoopBack 3 is in extended LTS and the ecosystem is moving to LoopBack 4.
fix
Consider migrating to loopback-connector-mssql v5 (for LB4) or update your app.
affects: >=3.0.0
gotchaThe default schema is 'dbo'. If your tables are in a different schema (e.g., 'custom'), queries may fail.
fix
Set the 'schema' property in datasources.json to the desired schema name.
affects: >=1.0.0
gotchaTable/column names with spaces or special characters need to be escaped manually.
fix
Use backticks or escape in properties, or define remoting metadata.
affects: >=1.0.0
Errors
Common errors & fixes
Error: connect ETIMEDOUT
Database server unreachable or wrong host/port.
fix
Check host/port, firewall, and network connectivity.
Error: Login failed for user 'sa'.
Invalid credentials or SQL Server authentication disabled.
fix
Check username/password and enable SQL Server authentication in SQL Server.
Error: Cannot open database 'mydb' requested by the login.
The database does not exist or the user lacks permission.
fix
Verify the database name and grant access to the user.
Error: The table 'MyTable' is not found in the database.
Mismatched schema or table name.
fix
Check the table name, schema, and ensure it exists.
Upgrade
Version history
3.6.2latest on npm
Audit
Dependencies
mssqlrequiredUnderlying SQL Server driver for Node.js
Agent activity
6 hits · last 30 days
node
5
Resources
loopback-connector-mssql-regevbr — npm install loopback-connector-mssql-regevbr · libregistry