@prisma-next/sql-orm-client 0.5.0-dev.6 → 0.5.0-dev.8

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
@@ -49,8 +49,28 @@ const posts = await db.Post
49
49
  .all();
50
50
  ```
51
51
 
52
+ ## Codec Roundtrip
53
+
54
+ The runtime always awaits codec query-time methods, but rows yielded to user code carry **plain field values** — no `Promise`-typed fields ever reach `.first()` / `.all()` / streaming consumers, regardless of whether a column's codec is sync or async. This is true for both one-shot and streaming usage:
55
+
56
+ ```ts
57
+ // Even if `secretCodec.decode` is async, `posts[0].secret` is a plain string here.
58
+ const posts = await db.Post.where((p) => p.userId.eq(userId)).all();
59
+ posts[0].secret.length;
60
+
61
+ // Same for streaming via AsyncIterableResult.
62
+ for await (const post of db.Post.where(...).stream()) {
63
+ post.secret.length;
64
+ }
65
+ ```
66
+
67
+ Read and write surfaces share **one** field type-map. `MutationUpdateInput`, `CreateInput`, `UniqueConstraintCriterion`, `ShorthandWhereFilter`, and `DefaultModelInputRow` accept plain `T` regardless of how the corresponding codec was authored.
68
+
69
+ See [ADR 204 — Single-Path Async Codec Runtime](../../../docs/architecture%20docs/adrs/ADR%20204%20-%20Single-Path%20Async%20Codec%20Runtime.md).
70
+
52
71
  ## Related Docs
53
72
 
54
73
  - [Architecture Overview](../../../docs/Architecture%20Overview.md)
55
74
  - [ADR 164 - Repository Layer](../../../docs/architecture%20docs/adrs/ADR%20164%20-%20Repository%20Layer.md)
75
+ - [ADR 204 - Single-Path Async Codec Runtime](../../../docs/architecture%20docs/adrs/ADR%20204%20-%20Single-Path%20Async%20Codec%20Runtime.md)
56
76
  - [Query Lanes Subsystem](../../../docs/architecture%20docs/subsystems/3.%20Query%20Lanes.md)