Registry / database / aurora-orm

aurora-orm

JSON →
library2.59.3jsnpmunverified

A near-zero runtime ORM and migration tool for PostgreSQL, targeting Node.js and TypeScript. Version 2.59.3, with a weekly release cadence. Unlike traditional ORMs like TypeORM or Sequelize, Aurora ORM avoids decorators and reflect-metadata, enabling compatibility with modern transpilers like SWC and ESbuild. It uses a Data Mapper pattern, provides type-safe column mappings, supports transactions, relations, indexes, and automated migrations. The library is authored primarily for personal use and is not intended as a fully open-source community project.

npm install aurora-orm
INSTALL
IMPORT
SIG · AURORA-ORM
A
aurora-orm
databasejavascriptv2.59.3
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.

connect
✓ import { connect } from 'aurora-orm'
✗ const { connect } = require('aurora-orm')
ESM-only; require() will not work.
Drivers
✓ import { Drivers } from 'aurora-orm'
✗ import Drivers from 'aurora-orm'
Named export, not default.
createModel
✓ import { createModel } from 'aurora-orm'
✗ import { createModel } from 'aurora-orm/models'
createModel is a top-level export, not a subpath.
runMigrationsAndExit
✓ import { runMigrationsAndExit } from 'aurora-orm'
✗ import { runMigrationsAndExit } from 'aurora-orm/migrator'
Exported from the main package entry.

Connects to PostgreSQL, defines a User model with type-safe mapping, creates a user, and retrieves all users.

import { connect, createModel, Drivers } from 'aurora-orm'; interface User { id: number; name: string; age: number | null; } const UserModel = createModel<User>({ table: 'users', mapping: { id: 'id', name: 'name', age: 'age', }, }); async function main() { await connect({ config: { driver: Drivers.Postgres, connectionString: process.env.DATABASE_URL ?? 'postgres://test:test@localhost:5432/test', }, }); const user = await UserModel.create({ name: 'Alice', age: 30 }); console.log('Created user:', user); const users = await UserModel.findAll(); console.log('All users:', users); } main().catch(console.error);
Debug
Known issues
gotchaThe library is authored for personal use and may not adhere to semver or provide extensive community support.
fix
Evaluate risks; consider using more established ORMs for production-critical applications.
affects: >=0.0.0
breakingIn version 2.x, `connect` no longer accepts a callback or returns a promise that resolves to a connection; it now returns void and throws on failure.
fix
Use try/catch around await connect(...) to handle connection errors.
affects: >=2.0.0
deprecated`findOne` with an ID as a number is deprecated; use object filter syntax instead.
fix
Replace `findOne(1)` with `findOne({ id: 1 })`.
affects: >=2.30.0
Errors
Common errors & fixes
Error: Module not found: Default condition should be last one
Using `require` to import an ESM-only package
fix
Use `import` statements or set `"type": "module"` in package.json.
TypeError: connect is not a function
Importing `connect` as a default import
fix
Use named import: `import { connect } from 'aurora-orm'`.
Error: Cannot find module 'tsx'
Missing peer dependency for running migration scripts
fix
Install tsx: `npm install -D tsx`
Upgrade
Version history
2.59.3latest on npm
Audit
Dependencies
tsxoptionalRequired for running migration scripts with `tsx` commands
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
aurora-orm — npm install aurora-orm · libregistry