require and go. No build step, no types.ts-prorm-orm is a TypeScript ORM covering 77 SQL dialects, 6 graph querynpm install ts-prorm-orm better-sqlite3pnpm add ts-prorm-orm better-sqlite3yarn add ts-prorm-orm better-sqlite3bun add ts-prorm-orm better-sqlite3prorm packagesimport { Prorm, DataTypes, Op } from 'ts-prorm-orm';
const prorm = new Prorm({ dialect: 'sqlite', storage: ':memory:' });
await prorm.connect();
const User = prorm.define('User', {
id: { type: DataTypes.INTEGER(), primaryKey: true, autoIncrement: true },
name: { type: DataTypes.STRING(100), allowNull: false },
email: { type: DataTypes.STRING(255), allowNull: false, unique: true },
age: { type: DataTypes.INTEGER() },
}, { tableName: 'users', timestamps: true });
await prorm.sync();
await User.create({ name: 'Ada', email: 'ada@example.com', age: 36 });
const adults = await User.findAll({ where: { age: { [Op.gte]: 18 } } });define(), decorators, table options, timestamps, soft deletes, sync().DataTypes.* and its SQL on each dialect.typeMapping: 'legacy' vs 'modern', and which 4.8 columns need a manual migration.where, order, pagination, aggregates, writes — with the SQL.Op.* reference.pipe() and Q — Composing FindOptions step by step, and how the steps merge.hasOne, hasMany, belongsTo, belongsToMany.include, nested loads, filtering includes, N+1.| Guide | What it covers |
|---|---|
| Bulk operations | bulkCreate, bulkUpdate, increment, batching |
| Transactions | Callback and manual modes, isolation levels, savepoints |
| Raw queries | prorm.query(), replacements, query types |
| Streaming | Cursors, paginated fallback, transform pipelines |
| Scopes | Reusable, composable query fragments |
| Hooks | The lifecycle events and when each fires |
| Validation | Field and model validators |
| Virtual fields | Computed attributes with no column |
| Error handling | The error hierarchy and how to branch on it |
| Guide | What it covers |
|---|---|
| Indexes & constraints | Declarative and runtime index/constraint management |
| Schema objects | Views, materialized views, sequences, triggers, procedures, RLS, partitions |
| Migrations | Migration files, the Migrator, seeders |
| QueryInterface | The imperative schema API migrations use |
| Schema diffing | Diff models against the live database, generate migrations |
| Prisma import | Convert a schema.prisma into models and a migration |
| Models from a database | prorm models pull: generate models from any live SQL database, every dialect |
| Guide | What it covers |
|---|---|
| Connection pooling | Pool sizing, lifecycle, events |
| Multiple databases | ConnectionManager, cross-database queries |
| Read replicas | Routing strategies, lag detection, health |
| Caching | L1/L2 cache, Redis cluster backend, invalidation |
| Query optimization | EXPLAIN plans, hints, slow-query logging, batching |
| Logging | Query logging, the Logger, query events |
| Guide | What it covers |
|---|---|
| Decorators | The class-based API and the full decorator families |
| TypeScript types | InferAttributes, CreationOptional, ModelStatic |
| External fields | Column contents stored in S3, Redis, GCS, … |
| Enums and constants | The named vocabularies — constraint types, referential actions, isolation levels, index methods |
| SQL constants | Isolation levels, PRAGMAs, sql_mode, search path |
| Extensions | Declare extensions so sync() installs them; prorm extensions list/import/export; managed-service allow-lists; the 124-entry catalogue |
| Local databases | prorm db up --dialect postgres --ext pgvector,postgis: a pinned image, generated credentials, Docker or Podman |
| Guide | What it covers |
|---|---|
| Audit logging | Row-level change history |
| Audit levels & escalation | Levels on audit entries (RFC 5424 + outage, custom ladders), escalation policies as JSON, 30 presets, notifiers, aggregation, retention by level |
| StoreKey — passwordless prod-orm | Reach a prod-orm database with a .klock instead of a connection; described queries, TLS and Kerberos identity |
| Query firewall | Allow/block described as preset lists — allow('CRUD'), block(['DESTRUCTIVE', 'OWASP']) — instead of raw regular expressions |
| User management | Database users, roles, GRANT / REVOKE |
| Compliance | Jurisdictions, frameworks, encryption, masking, retention, erasure, consent, residency, the sheet |
| Foreign data wrappers | Querying other servers from PostgreSQL |
| Runbooks | Backup/restore, failover, rollback, on-call, DR |
| Known issues | Security advisories (PRORM-SA ids): risk level, likelihood, status, and the version and date each was resolved; how to report a vulnerability |
| Versions and their status | Every published version: current, deprecated or unsupported, the support policy, and how to upgrade |
| Security | Security overview, with detailed advisories for each fixed critical, high and medium issue: cause, impact, fix commit, how to verify and upgrade |
| Reference | What it covers |
|---|---|
| Database types | The full taxonomy — 22 types, 129 engines |
| SQL dialects | One page per dialect |
| Store adapters | 105 object, KV, document, search, queue, log and vector stores |
| Graph databases | Neo4j, Neptune, Gremlin, Dgraph through the model API |
| SPARQL / RDF triplestores | Stardog, Fuseki, Blazegraph, GraphDB, Virtuoso, AllegroGraph through the same graph dialect — the triple-mapping convention, and what SPARQL cannot express |
| ArangoDB (AQL) | Collections as labels, edge collections as edges, AQL compiled from ORM specs |
| Couchbase (N1QL) | Keyspace quoting, USE KEYS, the missing-index trap, and N1QL compiled from findAll-shaped specs |
| Loki (LogQL) | Stream selectors, pipelines, parsers, unwraps and metric aggregations compiled from LogQL-shaped specs — and the two string-quoting forms that keep them safe |
| InfluxDB (Flux) | A pipeline spec rather than a findAll, every stage compiled, and why escaping is the only safety net |
| Prometheus / VictoriaMetrics (PromQL) | Selectors, matchers, aggregations, the rate family and subqueries as a PromQL-shaped spec — plus what is escaped, what is refused, and where MetricsQL diverges |
| Log search (SPL, Lucene, Papertrail, Sumo) | Four log languages compiled from structured specs — how much they genuinely share, the per-language escaping and wildcard rules, and what each one refuses |
| SQLite advanced | FTS5, JSON1, generated columns, PRAGMA tuning |
| Reference | What it covers |
|---|---|
| Seeders | Reference data and dev fixtures, with environments kept apart |
| Passwords | Hashing a password column with @Secure, and verifying one at sign-in |
| MCP server | The documentation as tools an AI agent can call |
| CLI | prorm — scaffolding, model generation, migrations, live-database inspection and maintenance, cloud commands |
| Terraform | The gitlab.com/prod-orm/prorm/restapi module: a database, its stores, pools, keys, users, network access, rules, roles and policies — declared, in a team project |
| In the browser | The CDN build: SQLite in the page, web storage, cookies, PouchDB/RxDB |
| Diagrams | SVG ER, class, model, migration and 11 other diagram generators |
| Docker | Running each engine locally in Docker |
dialects — the Dialect contract and per-engine implementationsmodels — the model layerquery-builders — where/order/include → SQL, and the typed SQL function libraryquery-optimizers — optimizer internalsmigrations — migration runner internalscompliance — per-file compliance status and known issuesdecorators — every decorator, option by optionextensions — the extension catalogue's shapeCONNECTIONS — pooling, connection/replica management, transactions, hooksUTILITIES — errors, validators, logging, audit, caching, diagrams, streamscli — how the CLI is put togethersql blocks are the statements the ORM actually emits, captured from the"col" / `col` /[col]) and placeholders (? / $1 / :1), and where a dialect does