Registry / database / redshift-sql

redshift-sql

JSON →
library1.0.2jsnpmunverified

A lightweight wrapper around node-postgres (pg) for running AWS Redshift queries. Version 1.0.2 is the latest stable release. It simplifies connection handling and query execution but has no release cadence documented. It is thin, minimal, and dependency-light compared to full ORMs, relying on pg for the PostgreSQL protocol.

npm install redshift-sql
INSTALL
IMPORT
SIG · REDSHIFT-SQL
R
redshift-sql
databasejavascriptv1.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.

default
import rssql from 'redshift-sql';
const { rssql } = require('redshift-sql');
Module exports a factory function that takes config and returns a query function.
require('redshift-sql')
const rssql = require('redshift-sql')(config);
const rssql = require('redshift-sql')(config, {})
CommonJS usage; must immediately invoke with config object.
rssql
rssql(query, callback);
rssql(query);
Callback-based API; no Promise support in current version.

Shows how to configure, connect to Redshift, and run a simple SELECT query using callback pattern.

const config = { host: process.env.REDSHIFT_HOST ?? 'localhost', db: process.env.REDSHIFT_DB ?? 'dev', user: process.env.REDSHIFT_USER ?? 'user', password: process.env.REDSHIFT_PASSWORD ?? 'pass' }; const rssql = require('redshift-sql')(config); const query = 'SELECT * FROM myTable LIMIT 10'; rssql(query, function(err, result) { if (err) { console.error(err); } else { console.log(result.rows); } });
Debug
Known issues
deprecatedThe package has not been updated since 1.0.2 (2017). Consider using pg directly or modern alternatives.
fix
Use pg (node-postgres) directly with Redshift-specific connection options.
affects: all
breakingMissing error handling for connection failures; callback may not be called in some edge cases.
fix
Wrap rssql in try-catch and add timeout logic.
affects: 1.0.0-1.0.2
gotchaNo Promise support; only callbacks. Using async/await requires promisification.
fix
Use util.promisify or wrap in a Promise manually: new Promise((res,rej) => rssql(query, (e,r) => e?rej(e):res(r)))
affects: all
gotchaDoes not support connection pooling; each instance creates a new pg.Client.
fix
Use pg Pool directly for multiple queries.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'redshift-sql'
Package not installed or typo in package name.
fix
Run 'npm install redshift-sql' and ensure package.json includes 'redshift-sql'.
TypeError: rssql is not a function
Importing the default export instead of calling it with config.
fix
Use 'const rssql = require('redshift-sql')(config);' or 'const rssql = require('redshift-sql'); rssql(config);'
Error: connect ECONNREFUSED <host>:5439
Incorrect host, port, or Redshift cluster is not accepting connections.
fix
Verify host, port (default 5439), and security group settings.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client for database connections and queries
Agent activity
4 hits · last 30 days
node
4
Resources
redshift-sql — npm install redshift-sql · libregistry