Registry / devops / knorm-postgres

knorm-postgres

JSON →
library2.0.0jsnpmunverified

knorm-postgres provides Docker-based PostgreSQL management commands (start, stop, remove) for testing knorm ORM and its plugins. Version 2.0.0 is the latest stable release, with infrequent updates. It simplifies setting up disposable PostgreSQL containers for integration tests, defaulting to port 5616 and credentials knorm/knorm. Unlike general Docker tools, it is tightly coupled with knorm's testing workflow.

npm install knorm-postgres
INSTALL
IMPORT
SIG · KNORM-POSTGRES
K
knorm-postgres
devopsjavascriptv2.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.

start
const postgres = require('knorm-postgres'); postgres.start();
import { start } from 'knorm-postgres'
Package is CJS-only; ESM import not available.
stop
const postgres = require('knorm-postgres'); postgres.stop();
import { stop } from 'knorm-postgres'
CJS default export with methods; no named exports.
remove
const postgres = require('knorm-postgres'); postgres.remove();
import { remove } from 'knorm-postgres'
CJS default export; use destructuring on default export only for CJS require.

Demonstrates starting, stopping, and removing a PostgreSQL Docker container via knorm-postgres CLI commands.

const postgres = require('knorm-postgres'); // Start a PostgreSQL container postgres.start({ name: 'my-postgres' }) .then(() => console.log('Container started')) .catch(err => console.error(err)); // Later: stop and remove postgres.stop({ name: 'my-postgres' }); postgres.remove({ name: 'my-postgres' });
Debug
Known issues
gotchaContainer name defaults to 'knorm-postgres' and may conflict if running multiple instances.
fix
Provide a unique name via the 'name' option.
affects: >=1.0.0
gotchaEnvironment variables (POSTGRES_PORT, etc.) are only applied when creating a new container, not on subsequent starts.
fix
Remove existing container and restart to apply new env vars.
affects: >=1.0.0
breakingVersion 2.0.0 dropped support for Node.js < 10.
fix
Upgrade Node.js to >=10 or use knorm-postgres@1.x
affects: >=2.0.0
Errors
Common errors & fixes
Error: docker is not installed
Docker not available on the system.
fix
Install Docker from https://docs.docker.com/get-docker/
Error: Container name 'knorm-postgres' is already in use
A container with the same name already exists (running or stopped).
fix
Use a different name or remove the existing container: knorm-postgres remove
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
knormrequiredcore ORM library; this package provides testing utilities for knorm
Agent activity
4 hits · last 30 days
node
4
Resources
knorm-postgres — npm install knorm-postgres · libregistry