{"id":43484,"library":"nos-sql","title":"nos-sql","description":"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.","status":"active","version":"4.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install nos-sql","lang":"bash","label":"npm"},{"cmd":"yarn add nos-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add nos-sql","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export in ESM; named import will fail.","wrong":"import { NosSql } from 'nos-sql'","symbol":"NosSql","correct":"import NosSql from 'nos-sql'"},{"note":"CommonJS default import; destructuring will not work as default is not a named export.","wrong":"const { NosSql } = require('nos-sql')","symbol":"NosSql (require)","correct":"const NosSql = require('nos-sql')"},{"note":"TypeScript only; DatabaseConfig is a named type export.","wrong":"import { DatabaseConfig } from 'nos-sql' with missing default import","symbol":"DatabaseConfig","correct":"import NosSql, { DatabaseConfig } from 'nos-sql'"}],"quickstart":{"code":"import NosSql from 'nos-sql';\n\nconst sql = new NosSql({\n    database: process.env.DB_NAME ?? 'mydb',\n    user: process.env.DB_USER ?? 'user',\n    password: process.env.DB_PASSWORD ?? 'password',\n    server: process.env.DB_SERVER ?? 'localhost',\n    port: parseInt(process.env.DB_PORT ?? '1203'),\n});\n\nasync function main() {\n    try {\n        const results = await sql.storedProcedure('GetUsers', { active: true });\n        console.log('Users:', results);\n    } catch (err) {\n        console.error('Error:', err);\n    } finally {\n        await sql.close();\n    }\n}\n\nmain();","lang":"typescript","description":"Shows instantiation of NosSql, calling a stored procedure with parameters, and closing the connection."},"warnings":[{"fix":"Ensure you are using Node.js 20+ and have the required database driver (likely 'mssql') installed as a peer dependency.","message":"Package is designed for IBI Data's internal Node Starter; may not work out of the box with other setups.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use parseInt() or ensure port is numeric, e.g., port: 1203.","message":"port must be a number; passing a string will cause a runtime error.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Ensure that parameter values match the SQL parameter types expected by the procedure.","message":"The package uses automatic parameter type detection; mismatched types may cause unexpected errors in stored procedures.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"search_vec":"'20':42 '4.0.2':14 'adapt':70 'automat':44 'call':20 'commonj':33 'connect':49 'data':9,57 'databas':28 'definit':38 'es':30 'full':35 'general':67 'ibi':8,56 'interfac':18 'intern':59 'javascript':71 'may':62 'modul':6,31 'node':11 'node.js':41 'nos':2 'nos-sql':1 'optim':39 'packag':52 'pool':50 'procedur':22 'provid':15 'queri':25,45 'result':46 'run':24 'simpl':17 'specif':54 'sql':3,5 'stack':60 'starter':12 'store':21 'suitabl':65 'support':29 'trim':47 'type':37 'typescript':36,72 'use':68 'version':13 'without':69","created_at":"2026-06-05T17:00:01.604964+00:00","updated_at":"2026-06-05T17:00:01.604964+00:00","problems":[{"fix":"Run: npm install mssql","cause":"Missing peer dependency 'mssql' required by nos-sql.","error":"Error: Cannot find module 'mssql'"},{"fix":"Use: import NosSql from 'nos-sql'","cause":"Using named import instead of default import in ESM.","error":"TypeError: nos_sql_1.default is not a constructor"},{"fix":"Check that 'mssql' is installed and config object is valid.","cause":"Instantiation failed (often due to missing peer dependency or invalid config).","error":"TypeError: sql.storedProcedure is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://bitbucket.org/IBIData/nos-sql#readme","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"nos-sql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}