Registry / database / run-pg-sql

run-pg-sql

JSON →
library1.2.0jsnpmunverified

Minimal CLI tool to execute a SQL file against PostgreSQL using pg-promise, designed for npx invocations with zero configuration. v1.2.0 (stable), maintained by GasBuddy. Unlike heavier migration tools, it focuses on one-off SQL execution with environment variable config. Low dependency footprint, TypeScript types included, Node >=18 required.

npm install run-pg-sql
INSTALL
IMPORT
SIG · RUN-PG-SQL
R
run-pg-sql
databasejavascriptv1.2.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.

(CLI)
npx @gasbuddy/run-pg-sql --help
npm install -g run-pg-sql
Package is designed for npx, not global install.

Shows how to execute a SQL file using DATABASE_URL environment variable and npx.

DATABASE_URL=postgres://user:pass@localhost/mydb npx @gasbuddy/run-pg-sql ./migration.sql
Debug
Known issues
breakingRequires Node >18.0.0. Older Node versions will crash.
fix
Upgrade Node to 18 or later.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'pg-promise'
Local dependencies missing when running without npx.
fix
Use npx @gasbuddy/run-pg-sql to auto-fetch dependencies.
Error: connect ECONNREFUSED 127.0.0.1:5432
DATABASE_URL not set or incorrect.
fix
Set DATABASE_URL environment variable to valid PostgreSQL connection string.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
pg-promiserequiredPostgreSQL client for query execution
Agent activity
6 hits · last 30 days
node
4
Meta
1
Resources
run-pg-sql — npm install run-pg-sql · libregistry