Registry / database / metal-orm

metal-orm

JSON →
library1.1.11jsnpmunverified

MetalORM is a TypeScript-first ORM and SQL query builder for Node.js (v20+) that supports gradual adoption from raw SQL building to full ORM with entities, Unit of Work, and decorators. Version 1.1.11 is currently stable, with active development and monthly releases. Key differentiators: zero `any` types in codebase, AST-driven architecture enabling multi-dialect support (MySQL, PostgreSQL, SQLite, SQL Server), and three abstraction levels (query builder, ORM runtime, decorator entities) that share the same foundation. It ships with TypeScript types and peer dependencies for popular database drivers.

database
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.

ESM-only package; require is not supported.

import { defineTable } from 'metal-orm'

col is exported from the main entry, not a subpath.

import { col } from 'metal-orm'

selectFrom is exported from the main entry.

import { selectFrom } from 'metal-orm'

Defines a table with typed schema, builds a query, and compiles to SQL using MySQL dialect.

import { defineTable, col, selectFrom, MySqlDialect } from 'metal-orm'; const users = defineTable('users', { id: col.primaryKey(col.int()), name: col.varchar(255), }); const query = selectFrom(users).select('id', 'name').limit(10); const { sql, params } = query.compile(new MySqlDialect()); console.log(sql); // SELECT id, name FROM users LIMIT 10 console.log(params); // []
Debug
Known footguns
breakingNode.js <20 is not supported. Engine requirement is >=20.0.0
deprecatedThe `@Entity` decorator does not support automatic table name resolution; you must provide an explicit name.
gotchaPeer dependencies for database drivers are optional but compilation will fail if a dialect is used without the corresponding driver installed.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources