Registry / database / embedded-postgres-cli

embedded-postgres-cli

JSON →
library0.0.2jsnpmunverified

Command-line interface for managing an embedded PostgreSQL server, wrapping the embedded-postgres library. Version 0.0.2 requires Node >=16. Provides start/clean commands, supports configuration via RC file, and runs PostgreSQL dynamically without external installation. Different from full PostgreSQL setup tools by being lightweight and test/sandbox oriented.

npm install embedded-postgres-cli
INSTALL
IMPORT
SIG · EMBEDDED-POSTGRES-
E
embedded-postgres-cli
databasejavascriptv0.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 (CLI)
npx pge start
npm start
CLI tool invoked via npx or global install. Not a library import.
default (programmatic)
const { EmbeddedPostgres } = require('embedded-postgres-cli');
import EmbeddedPostgres from 'embedded-postgres-cli'
Package is ESM? Not specified. The CLI does not export a programmatic API. Use embedded-postgres directly.
pge command
yarn pge start
node pge start
Install locally and use via yarn/npm scripts or global install.

Shows typical CLI usage: install, configure, start PostgreSQL, and clean up.

// Install globally or locally // npm install --save-dev embedded-postgres-cli // Add to package.json scripts: "scripts": { "pg": "pge start --port 5433 --user test --password test" } // Then run: // npm run pg // Or use npx directly: // npx pge start --port 5433 --user test --password test // For a specific database and custom data directory: // npx pge start mydb --data /tmp/pgdata --user myuser // Clean up after: // npx pge clean --data /tmp/pgdata
Debug
Known issues
gotchaThe default data directory is a user-specific absolute path; reusing across machines fails.
fix
Always specify --data or set in .embedded-postgresrc.
affects: >=0.0.0
deprecatedThe --data option is flagged as <PORT> in help, but accepts a directory path.
fix
Use --data /path/to/dir. The help typo will be fixed in future versions.
affects: 0.0.2
gotchaNo built-in graceful shutdown; stop via process kill or pge clean removes data.
fix
Use process management tools or send SIGTERM to child process.
affects: >=0.0.0
Errors
Common errors & fixes
Error: listen EADDRINUSE :::5432
Port already in use by another PostgreSQL instance.
fix
Use --port to specify a free port, e.g., --port 5433.
Error: Cannot find module 'embedded-postgres'
Missing peer dependency embedded-postgres.
fix
Install embedded-postgres: npm install embedded-postgres
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
embedded-postgresrequiredCore library for running embedded PostgreSQL instance
Agent activity
11 hits · last 30 days
node
10
Resources
embedded-postgres-cli — npm install embedded-postgres-cli · libregistry