Registry / database / devbox-sql

devbox-sql

JSON →
library1.2.4jsnpmunverified

A SQL connection management library for Node.js that wraps the mssql package, providing a simplified API for executing queries with input/output parameters and transaction support. Current stable version is 1.2.4. Release cadence is low (few updates). Key differentiator: it offers a thin convenience layer over mssql, but note the code appears to have a bug (require('devbox-box') instead of 'devbox-sql'). It supports both without-transaction and with-transaction request patterns and has a getOutput method to retrieve output parameters. Limited documentation and likely unstable for production use.

database
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.

The default export is a function that requires a connection configuration object.

const sql = require('devbox-sql')(connectionConfig);

request is a method that returns a request object, not a direct export.

sql.request();

transaction is a method on the sql instance, not a standalone export.

sql.transaction();

Initialize connection with config, execute a simple parameterized query using promise chain.

const config = { server: 'localhost', user: 'sa', password: 'pass', database: 'test' }; const sql = require('devbox-sql')(config); sql.request() .input('id', sql.types.Int, 1) .query('SELECT * FROM Users WHERE id = @id') .then(result => { console.log(result); }) .catch(err => { console.error(err); });
Debug
Known footguns
breakingThe library may have a bug in the require statement in its documentation (require('devbox-box') instead of 'devbox-sql').
gotchaThe default export is a function that must be called with a config object before using request/transaction methods.
deprecatedThe getOutput method returns only the first output parameter if called without argument, which may be confusing.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
bingbot
1
mj12bot
1
ahrefsbot
1
Resources