{"id":42618,"library":"dboa-js","title":"DBOA.js - Database Cleanup Assistant for Postgres","description":"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.","status":"active","version":"0.5.1","language":"javascript","source_language":"en","source_url":"https://github.com/apathinwalking/dboa-js","tags":["javascript","database","postgres","statistics","clean"],"install":[{"cmd":"npm install dboa-js","lang":"bash","label":"npm"},{"cmd":"yarn add dboa-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add dboa-js","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"PostgreSQL client for database connection","package":"pg","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require will fail.","wrong":"const dboa = require('dboa-js')","symbol":"default","correct":"import dboa from 'dboa-js'"},{"note":"Named export available since v0.5.0.","wrong":"const createAnalyzer = require('dboa-js').createAnalyzer","symbol":"createAnalyzer","correct":"import { createAnalyzer } from 'dboa-js'"},{"note":"Not default export; must be destructured.","wrong":"import cleanDuplicates from 'dboa-js'","symbol":"cleanDuplicates","correct":"import { cleanDuplicates } from 'dboa-js'"}],"quickstart":{"code":"import { createAnalyzer, cleanDuplicates } from 'dboa-js';\nimport pg from 'pg';\nconst pool = new pg.Pool({ connectionString: process.env.DATABASE_URL ?? '' });\nconst analyzer = createAnalyzer(pool);\nconst report = await analyzer.analyzeTable('users', { checkForNulls: true, checkForDuplicates: true });\nconsole.log(report);\nif (report.duplicates?.length) {\n  const cleaned = await cleanDuplicates(pool, 'users', report.duplicates[0].columns);\n  console.log(`Removed ${cleaned.deleted} duplicate rows.`);\n}\nawait pool.end();","lang":"typescript","description":"Connects to a Postgres database, analyzes a table for duplicates and nulls, and removes duplicates if found."},"warnings":[{"fix":"Run in a transaction and verify the report first.","message":"Database schema modifications are irreversible. Always backup before running cleanup operations.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Replace `analyze()` with `analyzeTable(tableName, options)`.","message":"The method `analyze` (without table parameter) is deprecated since v0.4.0. Use `analyzeTable` instead.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Ensure your database is PostgreSQL and the connection uses the `pg` driver.","message":"Only PostgreSQL databases are supported. Using with other SQL databases will result in runtime errors due to Postgres-specific queries.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always pass a `pg.Pool` instance, not a single `pg.Client`.","message":"The module uses `pg.Pool` internally. Passing a client instead of a pool may cause connection leaks.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.5.1':30 'analyz':17 'anomali':21 'api':62 'assist':4 'cadenc':35 'clean':11,73 'cleanup':3,45 'current':26 'data':66 'databas':2,15,70 'dboa.js':1 'detect':20,54 'differenti':37 'duplic':49 'focus':40 'foreign':52 'generat':23 'identif':58 'includ':38 'integr':64 'javascript':69 'key':36,53 'mainten':67 'messi':13 'miss':51 'moder':34 'modul':9 'orphan':56 'postgr':6,43,71 'postgres-specif':42 'postgresql':14 'record':57 'releas':31 'remov':50 'report':24 'simpl':61 'specif':44 'stabl':27 'statist':19,72 'tabl':18 'task':46 'util':8 'version':28 'workflow':68","created_at":"2026-06-05T16:55:51.225375+00:00","updated_at":"2026-06-05T16:55:51.225375+00:00","problems":[{"fix":"Install with `npm install dboa-js` and ensure your project is configured for ESM (add `\"type\":\"module\"` to package.json or use .mjs extension).","cause":"Package not installed or ESM import used in a CommonJS project.","error":"Cannot find module 'dboa-js'"},{"fix":"Use `import { cleanDuplicates } from 'dboa-js'` instead of `import cleanDuplicates from 'dboa-js'`.","cause":"Named import incorrectly used as default import.","error":"cleanDuplicates is not a function"},{"fix":"Check that PostgreSQL is running and the DATABASE_URL environment variable is set correctly (e.g., `postgres://user:pass@localhost:5432/dbname`).","cause":"Postgres not running or connection string is incorrect.","error":"Error: getaddrinfo ENOTFOUND localhost"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/apathinwalking/dboa-js#readme","github":"https://github.com/apathinwalking/dboa-js","docs":null,"changelog":null,"pypi":null,"npm":"dboa-js","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}