@sqb/mssql
v6.0.6
Published
SQB adapter for the mssql (tedious) driver
Readme
About SQB
SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
About @sqb/mssql
This package is a SQB Adapter for Microsoft SQL Server, backed by the
mssql driver (a pure-JS, tedious-based
client — no native bindings required).
Unlike MySQL/SQLite/Oracle, SQL Server has a native OUTPUT clause, so
INSERT ... RETURNING / UPDATE ... RETURNING do not need a follow-up SELECT — the
adapter rewrites the generated SQL to inject OUTPUT INSERTED.col, ... (or
OUTPUT DELETED.col for deletes) in the correct position and reads the result straight
from the same statement.
Installation
$ npm install @sqb/mssql --saveUsage
import '@sqb/mssql';
import { SqbClient } from '@sqb/connect';
const client = new SqbClient({
driver: 'mssql',
host: 'localhost',
port: 1433,
user: 'sa',
password: 'yourStrong(!)Password',
database: 'mydb',
});Node Compatibility
- node >= 20.x
License
SQB is available under MIT license.
