Eden DB is a Firebase-style PostgreSQL wrapper for Node.js and TypeScript that provides zero-config collections with auto-migration, transactions, and type-safe queries. Current version is 0.0.2, released as an early alpha. It differentiates from traditional ORMs like Sequelize or TypeORM by offering a simpler, document-like interface similar to Firestore, while using PostgreSQL as the backend. The library automatically creates tables on first use, supports raw SQL queries, and includes migration support. Note: version 0.0.2 is pre-stable and may have breaking changes.
npm install eden-dbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic CRUD operations: connect, insert, find, findById, query with filters, count, update, and delete.
Review the generated schema in your database after first insert and consider using explicit migrations via runMigrations().
Ensure table names match your schema or use raw SQL for custom tables.
Always pass the client parameter to collection methods inside transactions: db.collection('users').insert(data, client)None.
For complex counts, use raw SQL via db.query().
Use ES module syntax or set "type": "module" in package.json.
Pre-create tables via SQL or use runMigrations() once during startup to avoid repeated schema checks.
Run 'npm install eden-db pg' and ensure 'node_modules' is present. For TypeScript, ensure 'skipLibCheck' is false or add 'eden-db' to 'types' in tsconfig.json.
Use named import: import { db } from 'eden-db'Ensure 'await db.connect()' is called before any collection operations. The table is created on first insert; if you need pre-creation, run a manual migration.
Inside db.transaction callback, use db.collection('users').insert(data, client) where client is the argument of the callback.Set "type": "module" in package.json or use dynamic import: const { db } = await import('eden-db');