metal-orm 1.0.117 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,9 +86,10 @@ Full docs live in the `docs/` folder:
86
86
  - [OpenAPI Schema Generation](https://github.com/celsowm/metal-orm/blob/main/docs/openapi.md)
87
87
  - [DML Operations](https://github.com/celsowm/metal-orm/blob/main/docs/dml-operations.md)
88
88
  - [Hydration & Entities](https://github.com/celsowm/metal-orm/blob/main/docs/hydration.md)
89
- - [Runtime & Unit of Work](https://github.com/celsowm/metal-orm/blob/main/docs/runtime.md)
90
- - [Save Graph](https://github.com/celsowm/metal-orm/blob/main/docs/save-graph.md)
91
- - [Advanced Features](https://github.com/celsowm/metal-orm/blob/main/docs/advanced-features.md)
89
+ - [Runtime & Unit of Work](https://github.com/celsowm/metal-orm/blob/main/docs/runtime.md)
90
+ - [Save Graph](https://github.com/celsowm/metal-orm/blob/main/docs/save-graph.md)
91
+ - [Caching](https://github.com/celsowm/metal-orm/blob/main/docs/caching.md)
92
+ - [Advanced Features](https://github.com/celsowm/metal-orm/blob/main/docs/advanced-features.md)
92
93
  - [Multi-Dialect Support](https://github.com/celsowm/metal-orm/blob/main/docs/multi-dialect-support.md)
93
94
  - [Schema Generation (DDL)](https://github.com/celsowm/metal-orm/blob/main/docs/schema-generation.md)
94
95
  - [API Reference](https://github.com/celsowm/metal-orm/blob/main/docs/api-reference.md)
@@ -128,9 +129,10 @@ On top of the query builder, MetalORM ships a focused runtime managed by `Orm` a
128
129
  - **Lazy, batched relations**: `user.posts.load()`, `user.roles.syncByIds([...])`, etc.
129
130
  - **Scoped transactions**: `session.transaction(async s => { ... })` wraps `begin/commit/rollback` on the existing executor; `Orm.transaction` remains available when you want a fresh transactional executor per call.
130
131
  - **Identity map**: the same row becomes the same entity instance within a session (see the [Identity map pattern](https://en.wikipedia.org/wiki/Identity_map_pattern)).
132
+ - **Caching**: Flexible caching with `MemoryCacheAdapter` (dev) or `KeyvCacheAdapter` (Redis, etc.). Features human-readable TTL (`'30m'`, `'2h'`), tag-based invalidation, and multi-tenant cache isolation.
131
133
  - **Tree Behavior (Nested Set/MPTT)**: hierarchical data with `TreeManager`, `treeQuery()`, and `@Tree` decorators. Efficient O(log n) operations for moves, inserts, and deletes. Supports multi-tree scoping, recovery, and validation.
132
134
  - **DTO/OpenAPI helpers**: the `metal-orm/dto` module generates DTOs and OpenAPI schemas, including tree schemas (`TreeNode`, `TreeNodeResult`, threaded trees).
133
- - **Unit of Work (`OrmSession`)** tracking New/Dirty/Removed entities and relation changes, inspired by the classic [Unit of Work pattern](https://en.wikipedia.org/wiki/Unit_of_work).
135
+ - **Unit of Work (`OrmSession`)** tracking New/Dirty/Removed entities and relation changes, inspired by the classic [Unit of Work pattern](https://en.wikipedia.org/wiki/wiki/Unit_of_work).
134
136
  - **Graph persistence**: mutate a whole object graph and flush once with `session.commit()`.
135
137
  - **Partial updates**: use `session.patchGraph()` to update only specific fields of an entity and its relations (returns `null` if entity doesn't exist).
136
138
  - **Relation change processor** that knows how to deal with has-many and many-to-many pivot tables.
@@ -180,16 +182,26 @@ pnpm add metal-orm
180
182
 
181
183
  MetalORM compiles SQL; you bring your own driver:
182
184
 
183
- | Dialect | Driver | Install |
184
- | ------------------ | --------- | ---------------------- |
185
- | MySQL / MariaDB | `mysql2` | `npm install mysql2` |
186
- | SQLite | `sqlite3` | `npm install sqlite3` |
187
- | PostgreSQL | `pg` | `npm install pg` |
188
- | SQL Server | `tedious` | `npm install tedious` |
189
-
190
- Pick the matching dialect (`MySqlDialect`, `SQLiteDialect`, `PostgresDialect`, `MSSQLDialect`) when compiling queries.
191
-
192
- > Drivers are declared as optional peer dependencies. Install only the ones you actually use in your project.
185
+ | Dialect | Driver | Install |
186
+ | ------------------ | --------- | ---------------------- |
187
+ | MySQL / MariaDB | `mysql2` | `npm install mysql2` |
188
+ | SQLite | `sqlite3` | `npm install sqlite3` |
189
+ | PostgreSQL | `pg` | `npm install pg` |
190
+ | SQL Server | `tedious` | `npm install tedious` |
191
+
192
+ Pick the matching dialect (`MySqlDialect`, `SQLiteDialect`, `PostgresDialect`, `MSSQLDialect`) when compiling queries.
193
+
194
+ > Drivers are declared as optional peer dependencies. Install only the ones you actually use in your project.
195
+
196
+ **Optional: Caching Backend**
197
+
198
+ For production caching with Redis or other stores:
199
+
200
+ ```bash
201
+ npm install keyv @keyv/redis
202
+ ```
203
+
204
+ > The `keyv` package is optional. MetalORM includes `MemoryCacheAdapter` for development without external dependencies.
193
205
 
194
206
  ### Playground (optional) 🧪
195
207