Registry / database / dbgate-plugin-mssql

dbgate-plugin-mssql

JSON →
library7.1.13jsnpmunverified

dbgate-plugin-mssql is a plugin for DbGate that enables connecting to Microsoft SQL Server databases. It is part of the DbGate ecosystem (v7), built on tedious and mssql packages. This plugin is automatically included in the DbGate desktop application as a builtin plugin. It provides basic connectivity, query execution, and schema browsing. The plugin is maintained alongside the main DbGate releases. As a plugin, it does not have a standalone use outside of DbGate; developers install it via npm when embedding DbGate web version in their own applications. Version 7.1.13 is the latest stable release.

npm install dbgate-plugin-mssql
INSTALL
IMPORT
SIG · DBGATE-PLUGIN-MSSQ
D
dbgate-plugin-mssql
databasejavascriptv7.1.13
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.

default import (plugin registration)
import mssqlPlugin from 'dbgate-plugin-mssql'
const mssqlPlugin = require('dbgate-plugin-mssql')
The plugin object is exported as default. Use ESM import; CommonJS require works but may cause issues with ESM-only peer deps.
MssqlConnection
import { MssqlConnection } from 'dbgate-plugin-mssql'
const { MssqlConnection } = require('dbgate-plugin-mssql')
Named export for the connection class. TypeScript types are included.
MssqlDriver
import { MssqlDriver } from 'dbgate-plugin-mssql'
import MssqlDriver from 'dbgate-plugin-mssql'
MssqlDriver is a named export, not default. Common mistake using default import.

Registers the MSSQL plugin with DbGate, creates a connection to a SQL Server instance using environment variables, runs a simple query, logs results, and closes the connection.

import mssqlPlugin from 'dbgate-plugin-mssql'; import { DbGate } from 'dbgate-core'; const dbgate = new DbGate(); dbgate.registerPlugin(mssqlPlugin); const connection = await dbgate.createConnection({ engine: 'mssql@dbgate-plugin-mssql', server: process.env.MSSQL_HOST ?? 'localhost', port: parseInt(process.env.MSSQL_PORT ?? '1433'), user: process.env.MSSQL_USER ?? 'sa', password: process.env.MSSQL_PASSWORD ?? '', database: process.env.MSSQL_DATABASE ?? 'master', requestTimeout: 15000, }); const rows = await connection.query('SELECT 1 AS test'); console.log(rows); await connection.close();
Debug
Known issues
deprecatedPlugin registration using dbgate-core v6 API is deprecated.
fix
Upgrade to dbgate-core v7 and use the new plugin registration pattern shown in quickstart.
affects: >=6.0.0 <7.0.0
gotchaThe 'engine' property must be exactly 'mssql@dbgate-plugin-mssql' (with the package name). Using 'mssql' alone will fail.
fix
Set engine to 'mssql@dbgate-plugin-mssql' when creating the connection.
affects: >=7.0.0
deprecatedUsing 'config' object with 'dialect' property is deprecated in favor of 'engine'.
fix
Replace 'dialect: 'mssql'' with 'engine: 'mssql@dbgate-plugin-mssql''.
affects: >=7.0.0
breakingSupport for Node.js <12 removed in v7.
fix
Use Node.js 12 or later.
affects: >=7.0.0
gotchaThe plugin depends on 'mssql' package which uses 'tedious' internally; ensure 'tedious' is installed if using npm (DbGate bundles it).
fix
Install mssql and tedious as dependencies if not using DbGate bundle.
affects: >=7.0.0
Errors
Common errors & fixes
Error: Cannot find module 'dbgate-plugin-mssql'
Package not installed or not in node_modules.
fix
Run 'npm install dbgate-plugin-mssql'.
TypeError: dbgate.registerPlugin is not a function
Using older dbgate-core version that does not expose registerPlugin.
fix
Upgrade dbgate-core to v7 and ensure DbGate instance is created properly.
Error: Connection failed - Login failed for user '...'
Invalid credentials or SQL Server authentication mode (mixed mode) not enabled.
fix
Verify username/password and enable SQL Server and Windows Authentication mode in SQL Server.
Error: Failed to connect to DB: Connection refused
SQL Server not running, firewall blocking port 1433, or wrong host/port.
fix
Check SQL Server service is running, firewall allows port 1433, and host/port are correct.
Upgrade
Version history
7.1.13latest on npm
Audit
Dependencies
dbgate-corerequiredCore DbGate library required for plugin integration
mssqlrequiredSQL Server client library underlying the connection
tediousrequiredPure JS TDS driver for SQL Server
Agent activity
6 hits · last 30 days
node
6
Resources
dbgate-plugin-mssql — npm install dbgate-plugin-mssql · libregistry