Registry / database / seriate

seriate

JSON →
library5.0.0jsnpmunverified

A cross-platform Node.js module for Microsoft SQL Server based on node-mssql, providing connection pooling, transaction contexts, and straightforward query APIs. Current stable version is 5.0.0. Seriate wraps mssql to offer simplified configuration with named connection pools, automatic pooling per database, and shortcut methods like execute and executeTransaction. It emits connectivity events and supports SQL Server, Windows/NTLM authentication. Release cadence is low, primarily maintenance. Differentiator: opinionated pooling and context management reduces boilerplate for SQL Server operations in Node.js.

npm install seriate
INSTALL
IMPORT
SIG · SERIATE
S
seriate
databasejavascriptv5.0.0
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.

seriate
import seriate from 'seriate'
const seriate = require('seriate')
Package is ESM-only; CommonJS require will fail.
addConnection
import { addConnection } from 'seriate'
import addConnection from 'seriate/addConnection'
Named export from root module, not a subpath.
setDefault
import { setDefault } from 'seriate'
import * as seriate from 'seriate'; seriate.setDefault(config)
Exported as named member; namespace import also works but named is preferred.

Configures a default connection pool using environment variables, executes a simple SELECT query, and listens for connectivity events.

import seriate from 'seriate'; const config = { host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'sa', password: process.env.DB_PASSWORD ?? '', database: 'master', pool: { max: 10, min: 4, idleTimeoutMillis: 30000 } }; seriate.setDefault(config); seriate.execute({ query: 'SELECT 1 AS test', params: {} }).then(result => { console.log(result); }).catch(err => { console.error(err); }); seriate.on('connected', ({ name }) => console.log(`Connected: ${name}`)); seriate.on('failed', ({ name, error }) => console.error(`Failed: ${name}`, error));
Debug
Known issues
breakingv5 drops CommonJS support; ESM only.
fix
Use import syntax instead of require().
affects: >=5.0.0
deprecatedv5 deprecated direct method imports like seriate.execute without a connection argument; use contexts or explicit connection names.
fix
Pass connection name as first argument or use setDefault first.
affects: >=5.0.0
gotchaConnection config 'host' must not be '.'; use 'localhost' or actual hostname for named instances.
fix
Use 'localhost' instead of '.' or '127.0.0.1'.
affects: >=1.0.0
gotchaMultiple connection pools for same database are not created; pool parameters are ignored if config matches existing pool.
fix
Ensure unique host/user/database combinations for separate pools.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'seriate'
Package not installed or imported incorrectly in CommonJS environment.
fix
npm install seriate; use ESM import syntax (import seriate from 'seriate')
TypeError: seriate.execute is not a function
Calling seriate.execute without importing as default or using named import incorrectly.
fix
import seriate from 'seriate' or import { execute } from 'seriate'
ConnectionError: Failed to connect to localhost:1433 - Could not connect (sequence)
SQL Server not accessible; incorrect host, port, or firewall blocking.
fix
Check server address, port (default 1433), and ensure TCP/IP is enabled.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
mssqlrequiredUnderlying Microsoft SQL Server client driver; all database operations rely on it.
Agent activity
9 hits · last 30 days
node
8
Meta
1
Resources
seriate — npm install seriate · libregistry