prorm documentation

Read this page in the documentation

prorm documentation ts-prorm-orm is a TypeScript ORM covering 27 SQL dialects, 4 graph dialects and ~102 additional data stores. These pages are the developer-facing documentation: what each subsystem does, how to use it, and the SQL it produces. Start here Guide | What it covers | --- | --- | Defining models | define(), decorators, table options, timestamps, soft deletes, sync() | Data types | Every DataTypes. and its SQL on each dialect | Querying | Finders, where, order, pagination, aggregates, writes — with the SQL | Query operators | The complete Op. reference | SQL function builders | Aggregates, window functions, date/JSON/string/CASE — one call per dialect | Associations | hasOne, hasMany, belongsTo, belongsToMany | Eager loading | include, nested loads, filtering includes, N+1 | Working with data 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 | Schema 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 | Connections & scale 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 | Extending the model layer 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, … | SQL constants | Isolation levels, PRAGMAs, sqlmode, search path | Extension catalogue | 124 verified engine extensions, searchable | Operations, security & compliance Guide | What it covers | --- | --- | Audit logging | Row-level change history | User management | Database users, roles, GRANT / REVOKE | Compliance | Encryption, masking, retention, erasure, consent, firewall | Foreign data wrappers | Querying other servers from PostgreSQL | Runbooks | Backup/restore, failover, rollback, on-call, DR | Databases Reference | What it covers | --- | --- | Database types | The full taxonomy — 22 types, 129 engines | SQL dialects | 27 dialects, one page each | Store adapters | ~102 object, KV, document, search, queue and log stores | Graph databases | Neo4j, Neptune, Gremlin, Dgraph through the model API | SQLite advanced | FTS5, JSON1, generated columns, PRAGMA tuning | Tooling Reference | What it covers | --- | --- | CLI | orm-cli — scaffolding, model generation, migrations, cloud commands | Diagrams | SVG ER, class, model, migration and 11 other diagram generators | Docker | Running each engine locally in Docker | Architecture references Code-level documentation lives beside the source it describes: dialects — the Dialect contract and per-engine implementations models — the model layer query-builders — where/order/include → SQL, and the typed SQL function library query-optimizers — optimizer internals migrations — migration runner internals compliance — per-file compliance status and known issues decorators — every decorator, option by option extensions — the extension catalogue's shape CONNECTIONS — pooling, connection/replica management, transactions, hooks UTILITIES — errors, validators, logging, audit, caching, diagrams, streams cli — how the CLI is put together A note on the SQL in these pages The sql blocks are the statements the ORM actually emits, captured from the running code rather than written from memory, and are shown for SQLite unless a page says otherwise. Other dialects differ in quoting ("col" / col / [col]) and placeholders (? / $1 / :1), and where a dialect does something materially different the page says so. Where a feature is declared but does not work, these pages say that too, rather than documenting the intent. Those notes are marked in the relevant guide.