A utility module for cleaning up messy PostgreSQL databases by analyzing table statistics, detecting anomalies, and generating reports. The current stable version is 0.5.1, released with a moderate cadence. Key differentiators include a focus on Postgres-specific cleanup tasks such as duplicate removal, missing foreign key detection, and orphan record identification, with a simple API for integration into data maintenance workflows.
npm install dboa-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a Postgres database, analyzes a table for duplicates and nulls, and removes duplicates if found.
Run in a transaction and verify the report first.
Replace `analyze()` with `analyzeTable(tableName, options)`.
Ensure your database is PostgreSQL and the connection uses the `pg` driver.
Always pass a `pg.Pool` instance, not a single `pg.Client`.
Install with `npm install dboa-js` and ensure your project is configured for ESM (add `"type":"module"` to package.json or use .mjs extension).
Use `import { cleanDuplicates } from 'dboa-js'` instead of `import cleanDuplicates from 'dboa-js'`.Check that PostgreSQL is running and the DATABASE_URL environment variable is set correctly (e.g., `postgres://user:pass@localhost:5432/dbname`).