@prisma/orm-mongo 8.0.0-rc.26 → 8.0.0-rc.28

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.
Files changed (28) hide show
  1. package/dist/{mongo-static-DnxWWp96-D-vo6-SA.mjs → mongo-static-BcGm3FJA-Cu72kTZk.mjs} +3 -3
  2. package/dist/{mongo-static-DnxWWp96-D-vo6-SA.mjs.map → mongo-static-BcGm3FJA-Cu72kTZk.mjs.map} +1 -1
  3. package/dist/runtime.mjs +1 -1
  4. package/dist/runtime.mjs.map +1 -1
  5. package/dist/static.mjs +1 -1
  6. package/package.json +12 -12
  7. package/skills/prisma-8/SKILL.md +3 -3
  8. package/skills/prisma-8/references/contract.md +1 -1
  9. package/skills/prisma-8/references/scripts/find-detection-hits.ts +57 -0
  10. package/skills/prisma-8/references/upgrade-app.md +29 -10
  11. package/skills/prisma-8/references/upgrade-extension.md +24 -7
  12. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/instructions.md +139 -42
  13. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/contract-hash-inputs/contract-hash-inputs.ts +164 -12
  14. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/contract-signature-names/contract-signature-names.ts +110 -18
  15. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/facade-paths-an-application-uses/facade-paths-an-application-uses.ts +28 -6
  16. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/platform-paths-an-extension-uses/platform-paths-an-extension-uses.ts +70 -13
  17. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/stored-files-format-version/stored-files-format-version.ts +98 -13
  18. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.26-to-8.0.0-rc.27/instructions.md +102 -0
  19. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.27-to-8.0.0-rc.28/instructions.md +5 -0
  20. package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +2 -1
  21. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/instructions.md +33 -19
  22. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/contract-hash-inputs/contract-hash-inputs.ts +164 -12
  23. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/contract-signature-names/contract-signature-names.ts +110 -18
  24. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/facade-paths-an-application-uses/facade-paths-an-application-uses.ts +28 -6
  25. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/platform-paths-an-extension-uses/platform-paths-an-extension-uses.ts +70 -13
  26. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.25-to-8.0.0-rc.26/scripts/stored-files-format-version/stored-files-format-version.ts +98 -13
  27. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.26-to-8.0.0-rc.27/instructions.md +56 -0
  28. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.27-to-8.0.0-rc.28/instructions.md +5 -0
@@ -0,0 +1,56 @@
1
+ ---
2
+ from: "8.0.0-rc.26"
3
+ to: "8.0.0-rc.27"
4
+ changes:
5
+ - id: boolean-codec-type-takes-codec-types
6
+ summary: |
7
+ `BooleanCodecType` takes the contract's codec types, as `BooleanCodecType<CodecTypes>`; a use without type arguments no longer compiles.
8
+ detection:
9
+ glob: "**/*.{ts,tsx,mts,cts}"
10
+ matches:
11
+ - '(?<!\b(?:import|export)\s+(?:type\s+)?\{[^}]*)\bBooleanCodecType\b(?!\s*<)'
12
+ - id: function-condition-takes-codec-types
13
+ summary: |
14
+ `FunctionCondition` from the ORM client takes the contract's codec types; a use without type arguments no longer compiles.
15
+ detection:
16
+ glob: "**/*.{ts,tsx,mts,cts}"
17
+ matches:
18
+ - '(?<!\b(?:import|export)\s+(?:type\s+)?\{[^}]*)\bFunctionCondition\b(?!\s*<)'
19
+ - id: condition-codec-on-mysql-and-sqlite
20
+ summary: |
21
+ Only for an extension that runs on MySQL, MariaDB or SQLite: an extension that runs only on PostgreSQL changes nothing here. On those three targets a condition from `fns` is an expression of the target's boolean codec, and a selected condition reads as a boolean, or `null` when its value is NULL.
22
+ - id: functions-builders-no-longer-published
23
+ summary: |
24
+ `createFunctions` and `createAggregateFunctions` are no longer published; a callback of the query builder receives the functions they built as its `fns` argument, and a callback of the ORM receives the ORM's functions, built from `createFunctions`.
25
+ detection:
26
+ glob: "**/*.{ts,tsx,mts,cts}"
27
+ matches:
28
+ - '\bcreate(?:Aggregate)?Functions\b'
29
+ ---
30
+
31
+ # Conditions from `fns` carry the contract's boolean codec
32
+
33
+ ## `boolean-codec-type-takes-codec-types`
34
+
35
+ `BooleanCodecType`, exported by `@prisma/orm-family-sql/builder/types`, now takes the codec types of the contract and, optionally, a nullability. In code generic over a contract, pass the contract's codec types, such as `BooleanCodecType<ExtractCodecTypes<TContract>>` with `ExtractCodecTypes` from `@prisma/orm-family-sql/contract/types`; in a test against an emitted contract, pass its `CodecTypes`, as in `Expression<BooleanCodecType<CodecTypes>>`.
36
+
37
+ ## `function-condition-takes-codec-types`
38
+
39
+ `FunctionCondition`, exported by `@prisma/orm-family-sql/orm-client`, takes the contract's codec types the same way: `FunctionCondition<ExtractCodecTypes<TContract>>`.
40
+
41
+ ## `condition-codec-on-mysql-and-sqlite`
42
+
43
+ On MySQL, MariaDB and SQLite, a condition from `fns` is typed and built with the target's boolean codec, `mysql/boolean@1` on MySQL and MariaDB and `sqlite/boolean@1` on SQLite, where it was `pg/bool@1` on every target. An extension that runs on these targets and names `'pg/bool@1'` for a condition, in a type or in `fns.raw` with `.returns('pg/bool@1')`, names the target's boolean codec instead. A condition selected as a column on these targets now reads as `true` or `false`, or as `null` when one of its operands is nullable and its value is NULL. Before, it read as the text `'1'` or `'0'` on MySQL and MariaDB and as the number `1` or `0` on SQLite; code and tests that compare it with those values, or convert it with `Number(...)` or `Boolean(...)`, use the boolean instead. `Boolean('0')` is `true`, so such a conversion on MySQL and MariaDB was wrong before.
44
+
45
+ ## `functions-builders-no-longer-published`
46
+
47
+ `@prisma/orm-family-sql/builder/runtime` no longer exports `createFunctions` and `createAggregateFunctions`, and no other published path exports them. They built the functions that a callback of the query builder receives as its `fns` argument, and the ORM builds the `fns` of its callbacks from `createFunctions`, so code that called them takes `fns` from such a callback instead:
48
+
49
+ ```ts
50
+ // The query builder: the second argument of an expression callback, such as where, select, a join's on, orderBy, groupBy, having or the set of an update.
51
+ db.sql.public.user.select('id').where((f, fns) => fns.eq(f.id, 1));
52
+ // The ORM: the fns member of the second argument of a where or orderBy callback.
53
+ db.orm.public.User.where((user, { fns }) => fns.eq(user.id, 1));
54
+ ```
55
+
56
+ Code that called them to build a condition outside a query, such as in a test, builds a query with the query builder instead and reads the condition from the plan's syntax tree, such as the `where` of `db.sql.public.user.select('id').where((f, fns) => fns.eq(f.id, 1)).build().ast` after checking that its `kind` is `'select'`. That is a syntax-tree node, not the expression `createFunctions` returned.
@@ -0,0 +1,5 @@
1
+ ---
2
+ from: "8.0.0-rc.27"
3
+ to: "8.0.0-rc.28"
4
+ changes: []
5
+ ---