Registry / database / nos-sql

nos-sql

JSON →
library4.0.2jsnpmunverified

A SQL module for IBI Data's Node Starter, version 4.0.2. Provides a simple interface for calling stored procedures and running queries against a database. Supports ES Modules and CommonJS, with full TypeScript type definitions. Optimized for Node.js 20+ with automatic query result trimming and connection pooling. The package is specific to IBI Data's internal stack and may not be suitable for general use without adaptation.

npm install nos-sql
INSTALL
IMPORT
SIG · NOS-SQL
N
nos-sql
databasejavascriptv4.0.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.

NosSql
import NosSql from 'nos-sql'
import { NosSql } from 'nos-sql'
Default export in ESM; named import will fail.
NosSql (require)
const NosSql = require('nos-sql')
const { NosSql } = require('nos-sql')
CommonJS default import; destructuring will not work as default is not a named export.
DatabaseConfig
import NosSql, { DatabaseConfig } from 'nos-sql'
import { DatabaseConfig } from 'nos-sql' with missing default import
TypeScript only; DatabaseConfig is a named type export.

Shows instantiation of NosSql, calling a stored procedure with parameters, and closing the connection.

import NosSql from 'nos-sql'; const sql = new NosSql({ database: process.env.DB_NAME ?? 'mydb', user: process.env.DB_USER ?? 'user', password: process.env.DB_PASSWORD ?? 'password', server: process.env.DB_SERVER ?? 'localhost', port: parseInt(process.env.DB_PORT ?? '1203'), }); async function main() { try { const results = await sql.storedProcedure('GetUsers', { active: true }); console.log('Users:', results); } catch (err) { console.error('Error:', err); } finally { await sql.close(); } } main();
Debug
Known issues
gotchaPackage is designed for IBI Data's internal Node Starter; may not work out of the box with other setups.
fix
Ensure you are using Node.js 20+ and have the required database driver (likely 'mssql') installed as a peer dependency.
affects: >=4.0.0
gotchaport must be a number; passing a string will cause a runtime error.
fix
Use parseInt() or ensure port is numeric, e.g., port: 1203.
affects: >=4.0.0
gotchaThe package uses automatic parameter type detection; mismatched types may cause unexpected errors in stored procedures.
fix
Ensure that parameter values match the SQL parameter types expected by the procedure.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mssql'
Missing peer dependency 'mssql' required by nos-sql.
fix
Run: npm install mssql
TypeError: nos_sql_1.default is not a constructor
Using named import instead of default import in ESM.
fix
Use: import NosSql from 'nos-sql'
TypeError: sql.storedProcedure is not a function
Instantiation failed (often due to missing peer dependency or invalid config).
fix
Check that 'mssql' is installed and config object is valid.
Upgrade
Version history
4.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
nos-sql — npm install nos-sql · libregistry