Registry / database / bigbaby-pg

bigbaby-pg

JSON →
library2.0.29jsnpmunverified

A minimal ORM and RESTful router for PostgreSQL on Node.js (Koa), version 2.0.29. Provides automatic CRUD endpoints from database configurations, supports connection pooling, and integrates with Koa middleware. Designed for rapid API development with kendo grid compatibility. Includes file upload handling via koa-body. Uses configuration files in a 'dbhome' directory. Releases are infrequent; community is small.

npm install bigbaby-pg
INSTALL
IMPORT
SIG · BIGBABY-PG
B
bigbaby-pg
databasejavascriptv2.0.29
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.

bigbaby-pg
const pgdb = require('bigbaby-pg').create(__dirname + '/dbhome', '/api/dbop')
import { create } from 'bigbaby-pg'
Package is CJS only; no ESM exports. Use require().create() pattern.
Db
const { Db } = require('bigbaby-pg')
const Db = require('bigbaby-pg').Db
Db is a named export. Destructuring works.
Router (implicit)
app.use(pgdb.router.routes())
app.use(pgdb.router)
router is a property of the created object; use .routes() to get Koa-compatible middleware.

Shows how to set up a basic Koa server with bigbaby-pg ORM, including database configuration and automatic CRUD routes.

const path = require('path'); const Koa = require('koa'); const { create } = require('bigbaby-pg'); const app = new Koa(); const dbhome = path.join(__dirname, 'dbhome'); const pgdb = create(dbhome, '/api/dbop'); app.use(pgdb.router.routes()); app.listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
gotchacreate() function expects a directory path with DB config files (e.g., sysdb.json), not a single config. Ensure 'dbhome' folder contains correctly named JSON files.
fix
Create a 'dbhome' directory with JSON files like 'sysdb.json' containing database credentials.
affects: >=0.0.0
gotchaThe .router property returns a koa-router instance, but its .routes() method must be called before passing to app.use().
fix
Use app.use(pgdb.router.routes()) instead of app.use(pgdb.router).
affects: >=0.0.0
deprecatedThe package uses CJS require() style. No ESM or TypeScript definitions are provided.
fix
Use require() syntax; avoid import statements.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'bigbaby-pg'
Package not installed or missing from node_modules.
fix
Run npm install bigbaby-pg
TypeError: pgdb.router.routes is not a function
router property may be undefined if create() was called incorrectly.
fix
Ensure create() is called with correct arguments: a directory path and API base path (string).
Error: dbhome directory not found
The first argument to create() must be an existing directory containing database JSON config files.
fix
Create a directory (e.g., './dbhome') with at least one JSON config file (e.g., 'sysdb.json').
Upgrade
Version history
2.0.29latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client for Node.js
koaoptionalWeb framework for routing
koa-routeroptionalRouting middleware used internally
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
bigbaby-pg — npm install bigbaby-pg · libregistry