@prisma/orm-mongo 8.0.0-rc.9-dev.12 → 8.0.1-dev.1

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 (151) hide show
  1. package/README.md +48 -8
  2. package/dist/components-CWskH7lF-Dkc9ysZz.mjs +18 -0
  3. package/dist/components-CWskH7lF-Dkc9ysZz.mjs.map +1 -0
  4. package/dist/config.d.mts +14 -5
  5. package/dist/config.d.mts.map +1 -1
  6. package/dist/config.mjs +47 -25
  7. package/dist/config.mjs.map +1 -1
  8. package/dist/contract-builder.d.mts +33 -91
  9. package/dist/contract-builder.d.mts.map +1 -1
  10. package/dist/contract-builder.mjs +23 -7
  11. package/dist/contract-builder.mjs.map +1 -1
  12. package/dist/contract-types.d.mts +3 -0
  13. package/dist/contract-types.mjs +1 -0
  14. package/dist/contract__format-version.d.mts +1 -0
  15. package/dist/contract__format-version.mjs +2 -0
  16. package/dist/contract__internal__format-version.d.mts +1 -0
  17. package/dist/contract__internal__format-version.mjs +2 -0
  18. package/dist/contract__validate-once.d.mts +1 -0
  19. package/dist/contract__validate-once.mjs +2 -0
  20. package/dist/contract__validate-storage.d.mts +1 -0
  21. package/dist/contract__validate-storage.mjs +2 -0
  22. package/dist/control.d.mts +1 -1
  23. package/dist/control.d.mts.map +1 -1
  24. package/dist/control.mjs +3 -9
  25. package/dist/control.mjs.map +1 -1
  26. package/dist/driver__runtime.d.mts +3 -0
  27. package/dist/driver__runtime.mjs +3 -0
  28. package/dist/family-contract__data-type.d.mts +1 -0
  29. package/dist/family-contract__data-type.mjs +2 -0
  30. package/dist/init-quick-reference.md +116 -0
  31. package/dist/init-readme.md +35 -0
  32. package/dist/init.d.mts +7 -0
  33. package/dist/init.d.mts.map +1 -0
  34. package/dist/init.mjs +245 -0
  35. package/dist/init.mjs.map +1 -0
  36. package/dist/migration.d.mts +1 -0
  37. package/dist/migration.mjs +2 -0
  38. package/dist/module-base-B70DHaBE-k_c3Klu4.mjs +6 -0
  39. package/dist/module-base-B70DHaBE-k_c3Klu4.mjs.map +1 -0
  40. package/dist/mongo-static-CfvV1-qX-DdckMRxc.mjs +74 -0
  41. package/dist/mongo-static-CfvV1-qX-DdckMRxc.mjs.map +1 -0
  42. package/dist/{mongo-static-BdSGXYgQ-DSA-2DiK.d.mts → mongo-static-DabeBtmV-DILuhcbE.d.mts} +18 -5
  43. package/dist/mongo-static-DabeBtmV-DILuhcbE.d.mts.map +1 -0
  44. package/dist/runtime.d.mts +49 -44
  45. package/dist/runtime.d.mts.map +1 -1
  46. package/dist/runtime.mjs +104 -42
  47. package/dist/runtime.mjs.map +1 -1
  48. package/dist/static.d.mts +24 -2
  49. package/dist/static.d.mts.map +1 -0
  50. package/dist/static.mjs +2 -2
  51. package/dist/target__codec-ids.d.mts +1 -0
  52. package/dist/target__codec-ids.mjs +2 -0
  53. package/dist/target__codecs.d.mts +1 -0
  54. package/dist/target__codecs.mjs +2 -0
  55. package/dist/target__data-types.d.mts +1 -0
  56. package/dist/target__data-types.mjs +2 -0
  57. package/dist/target__server-version.d.mts +1 -0
  58. package/dist/target__server-version.mjs +2 -0
  59. package/dist/utils__guards.d.mts +1 -0
  60. package/dist/utils__guards.mjs +2 -0
  61. package/dist/utils__text.d.mts +1 -0
  62. package/dist/utils__text.mjs +2 -0
  63. package/dist/utils__upgrade-guides.d.mts +1 -0
  64. package/dist/utils__upgrade-guides.mjs +2 -0
  65. package/package.json +37 -13
  66. package/skills/prisma-8/SKILL.md +24 -19
  67. package/skills/prisma-8/references/build-a-target-package.md +117 -0
  68. package/skills/prisma-8/references/build.md +12 -16
  69. package/skills/prisma-8/references/contract.md +181 -75
  70. package/skills/prisma-8/references/debug.md +38 -27
  71. package/skills/prisma-8/references/feedback.md +8 -8
  72. package/skills/prisma-8/references/migration-model.md +28 -18
  73. package/skills/prisma-8/references/migration-review.md +24 -53
  74. package/skills/prisma-8/references/migrations.md +298 -84
  75. package/skills/prisma-8/references/queries-mongo.md +53 -17
  76. package/skills/prisma-8/references/queries-postgres.md +345 -34
  77. package/skills/prisma-8/references/queries.md +44 -25
  78. package/skills/prisma-8/references/quickstart.md +28 -25
  79. package/skills/prisma-8/references/runtime.md +172 -72
  80. package/skills/prisma-8/references/supabase.md +22 -19
  81. package/skills/prisma-8/references/upgrade-app.md +57 -22
  82. package/skills/prisma-8/references/upgrade-extension.md +72 -23
  83. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/instructions.md +1 -1
  84. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.10-to-8.0.0-rc.11/instructions.md +34 -0
  85. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +639 -0
  86. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/multifile-psl/add-use-prisma-8-directive.mjs +60 -0
  87. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/psl-verbatim-table-names/add-model-map.mjs +256 -0
  88. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/instructions.md +332 -0
  89. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/scripts/execution-ref-entry-field/rename-execution-ref-keys.ts +193 -0
  90. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.13-to-8.0.0-rc.14/instructions.md +489 -0
  91. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/instructions.md +1368 -0
  92. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/scripts/data-type-in-contract/data-type-in-contract.ts +1492 -0
  93. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.15-to-8.0.0-rc.16/instructions.md +108 -0
  94. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.16-to-8.0.0-rc.17/instructions.md +755 -0
  95. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/instructions.md +973 -0
  96. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/scripts/sql-expression-literals-psl/rewrite-sql-strings.mjs +271 -0
  97. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/instructions.md +1862 -0
  98. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/client-takes-contract-value/contract-from-json.ts +597 -0
  99. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/data-type-values/data-type-values.ts +1120 -0
  100. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/default-generators-to-on-create/rewrite-default-generators.mjs +86 -0
  101. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/mongo-field-storage-names/mongo-field-storage-names.ts +304 -0
  102. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/remove-nocheck/remove-nocheck.ts +2462 -0
  103. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/instructions.md +513 -0
  104. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/scripts/expand-type-aliases/expand-type-aliases.ts +1206 -0
  105. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.20-to-8.0.0-rc.21/instructions.md +803 -0
  106. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.21-to-8.0.0-rc.22/instructions.md +586 -0
  107. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.21-to-8.0.0-rc.22/scripts/value-objects-in-storage/value-objects-in-storage.ts +1184 -0
  108. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.22-to-8.0.0-rc.23/instructions.md +480 -0
  109. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.22-to-8.0.0-rc.23/scripts/mongo-index-names/mongo-index-names.ts +317 -0
  110. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/instructions.md +336 -0
  111. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-convenience-date-time-types/rewrite-mongo-date-types.ts +220 -0
  112. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-type-helpers/rewrite-mongo-field-types.ts +621 -0
  113. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.24-to-8.0.0-rc.25/instructions.md +1561 -0
  114. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.9-to-8.0.0-rc.10/instructions.md +13 -0
  115. package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +1 -1
  116. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/instructions.md +1 -1
  117. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.10-to-8.0.0-rc.11/instructions.md +34 -0
  118. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +857 -0
  119. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/psl-verbatim-table-names/add-model-map.mjs +256 -0
  120. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/instructions.md +504 -0
  121. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/scripts/execution-ref-entry-field/rename-execution-ref-keys.ts +193 -0
  122. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.13-to-8.0.0-rc.14/instructions.md +143 -0
  123. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/instructions.md +2168 -0
  124. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/scripts/data-type-in-contract/data-type-in-contract.ts +1492 -0
  125. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.15-to-8.0.0-rc.16/instructions.md +223 -0
  126. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.16-to-8.0.0-rc.17/instructions.md +583 -0
  127. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/instructions.md +1008 -0
  128. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/instructions.md +2186 -0
  129. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/client-takes-contract-value/contract-from-json.ts +597 -0
  130. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/data-type-values/data-type-values.ts +1120 -0
  131. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/default-generators-to-on-create/rewrite-default-generators.mjs +86 -0
  132. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/mongo-field-storage-names/mongo-field-storage-names.ts +304 -0
  133. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/remove-nocheck/remove-nocheck.ts +2462 -0
  134. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/instructions.md +381 -0
  135. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/scripts/expand-type-aliases/expand-type-aliases.ts +1206 -0
  136. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.20-to-8.0.0-rc.21/instructions.md +570 -0
  137. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.21-to-8.0.0-rc.22/instructions.md +464 -0
  138. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.22-to-8.0.0-rc.23/instructions.md +410 -0
  139. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/instructions.md +303 -0
  140. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-convenience-date-time-types/rewrite-mongo-date-types.ts +220 -0
  141. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-type-helpers/rewrite-mongo-field-types.ts +621 -0
  142. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.24-to-8.0.0-rc.25/instructions.md +1593 -0
  143. package/dist/adapter__codec-ids.d.mts +0 -1
  144. package/dist/adapter__codec-ids.mjs +0 -2
  145. package/dist/adapter__codec-types.d.mts +0 -1
  146. package/dist/adapter__codec-types.mjs +0 -2
  147. package/dist/adapter__codecs.d.mts +0 -1
  148. package/dist/adapter__codecs.mjs +0 -2
  149. package/dist/mongo-static-BdSGXYgQ-DSA-2DiK.d.mts.map +0 -1
  150. package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs +0 -38
  151. package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs.map +0 -1
package/package.json CHANGED
@@ -1,30 +1,41 @@
1
1
  {
2
2
  "name": "@prisma/orm-mongo",
3
- "version": "8.0.0-rc.9-dev.12",
3
+ "version": "8.0.1-dev.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
- "description": "Prisma 8 for MongoDB: the one package a MongoDB application installs",
7
+ "description": "Prisma 8 for MongoDB: the package a MongoDB application installs for its database, beside the platform packages it names as peers",
8
+ "keywords": [
9
+ "prisma-orm-extension"
10
+ ],
8
11
  "files": [
9
12
  "dist",
10
13
  "skills"
11
14
  ],
12
15
  "dependencies": {
13
- "@prisma/orm-family-mongo": "8.0.0-rc.9-dev.12",
14
- "@prisma/orm-framework": "8.0.0-rc.9-dev.12",
15
- "@prisma/orm-target-mongo": "8.0.0-rc.9-dev.12",
16
- "@prisma/orm-toolchain": "8.0.0-rc.9-dev.12",
17
- "pathe": "^2.0.3"
16
+ "mongodb-connection-string-url": "^7.0.2",
17
+ "pathe": "^2.0.3",
18
+ "tinyglobby": "^0.2.17",
19
+ "temporal-spec": "1.0.1"
18
20
  },
19
21
  "devDependencies": {
20
- "@internal/mongo": "8.0.0-rc.9-dev.12",
21
- "@repo/tsconfig": "8.0.0-rc.9-dev.12",
22
- "@repo/tsdown": "8.0.0-rc.9-dev.12",
22
+ "@internal/mongo": "8.0.1-dev.1",
23
+ "@prisma/orm-family-mongo": "8.0.1-dev.1",
24
+ "@prisma/orm-framework": "8.0.1-dev.1",
25
+ "@prisma/orm-target-mongo": "8.0.1-dev.1",
26
+ "@prisma/orm-toolchain": "8.0.1-dev.1",
27
+ "@repo/tsconfig": "8.0.1-dev.1",
28
+ "@repo/tsdown": "8.0.1-dev.1",
23
29
  "tsdown": "0.22.14",
24
30
  "typescript": "5.9.3"
25
31
  },
26
32
  "peerDependencies": {
33
+ "@prisma/orm-family-mongo": "8.0.1-dev.1",
34
+ "@prisma/orm-framework": "8.0.1-dev.1",
35
+ "@prisma/orm-target-mongo": "8.0.1-dev.1",
36
+ "@prisma/orm-toolchain": "8.0.1-dev.1",
27
37
  "mongodb": "^7.0.0",
38
+ "temporal-polyfill": "^1.0.8",
28
39
  "typescript": ">=5.9"
29
40
  },
30
41
  "peerDependenciesMeta": {
@@ -34,9 +45,6 @@
34
45
  },
35
46
  "exports": {
36
47
  "./adapter": "./dist/adapter.mjs",
37
- "./adapter/codec-ids": "./dist/adapter__codec-ids.mjs",
38
- "./adapter/codec-types": "./dist/adapter__codec-types.mjs",
39
- "./adapter/codecs": "./dist/adapter__codecs.mjs",
40
48
  "./adapter/control": "./dist/adapter__control.mjs",
41
49
  "./adapter/runtime": "./dist/adapter__runtime.mjs",
42
50
  "./bson": "./dist/bson.mjs",
@@ -57,16 +65,22 @@
57
65
  "./contract/contract-validation-error": "./dist/contract__contract-validation-error.mjs",
58
66
  "./contract/default-namespace": "./dist/contract__default-namespace.mjs",
59
67
  "./contract/enum-accessor": "./dist/contract__enum-accessor.mjs",
68
+ "./contract/format-version": "./dist/contract__format-version.mjs",
60
69
  "./contract/hashing": "./dist/contract__hashing.mjs",
61
70
  "./contract/hashing-utils": "./dist/contract__hashing-utils.mjs",
71
+ "./contract/internal/format-version": "./dist/contract__internal__format-version.mjs",
62
72
  "./contract/is-plain-record": "./dist/contract__is-plain-record.mjs",
63
73
  "./contract/resolve-domain-model": "./dist/contract__resolve-domain-model.mjs",
64
74
  "./contract/types": "./dist/contract__types.mjs",
65
75
  "./contract/validate-domain": "./dist/contract__validate-domain.mjs",
76
+ "./contract/validate-once": "./dist/contract__validate-once.mjs",
77
+ "./contract/validate-storage": "./dist/contract__validate-storage.mjs",
66
78
  "./contract-builder": "./dist/contract-builder.mjs",
79
+ "./contract-types": "./dist/contract-types.mjs",
67
80
  "./control": "./dist/control.mjs",
68
81
  "./driver": "./dist/driver.mjs",
69
82
  "./driver/control": "./dist/driver__control.mjs",
83
+ "./driver/runtime": "./dist/driver__runtime.mjs",
70
84
  "./family": "./dist/family.mjs",
71
85
  "./family/control": "./dist/family__control.mjs",
72
86
  "./family/control-adapter": "./dist/family__control-adapter.mjs",
@@ -77,8 +91,11 @@
77
91
  "./family/schema-verify": "./dist/family__schema-verify.mjs",
78
92
  "./family-contract": "./dist/family-contract.mjs",
79
93
  "./family-contract/canonicalization-hooks": "./dist/family-contract__canonicalization-hooks.mjs",
94
+ "./family-contract/data-type": "./dist/family-contract__data-type.mjs",
80
95
  "./family-contract/entity-kinds": "./dist/family-contract__entity-kinds.mjs",
81
96
  "./family-runtime": "./dist/family-runtime.mjs",
97
+ "./init": "./dist/init.mjs",
98
+ "./migration": "./dist/migration.mjs",
82
99
  "./migration-tools/aggregate": "./dist/migration-tools__aggregate.mjs",
83
100
  "./migration-tools/contract-snapshot-store": "./dist/migration-tools__contract-snapshot-store.mjs",
84
101
  "./migration-tools/hash": "./dist/migration-tools__hash.mjs",
@@ -93,11 +110,15 @@
93
110
  "./runtime": "./dist/runtime.mjs",
94
111
  "./static": "./dist/static.mjs",
95
112
  "./target": "./dist/target.mjs",
113
+ "./target/codec-ids": "./dist/target__codec-ids.mjs",
96
114
  "./target/codec-types": "./dist/target__codec-types.mjs",
115
+ "./target/codecs": "./dist/target__codecs.mjs",
97
116
  "./target/control": "./dist/target__control.mjs",
117
+ "./target/data-types": "./dist/target__data-types.mjs",
98
118
  "./target/migration": "./dist/target__migration.mjs",
99
119
  "./target/pack": "./dist/target__pack.mjs",
100
120
  "./target/runtime": "./dist/target__runtime.mjs",
121
+ "./target/server-version": "./dist/target__server-version.mjs",
101
122
  "./utils": "./dist/utils.mjs",
102
123
  "./utils/abortable": "./dist/utils__abortable.mjs",
103
124
  "./utils/array-equal": "./dist/utils__array-equal.mjs",
@@ -105,6 +126,7 @@
105
126
  "./utils/canonical-stringify": "./dist/utils__canonical-stringify.mjs",
106
127
  "./utils/casts": "./dist/utils__casts.mjs",
107
128
  "./utils/defined": "./dist/utils__defined.mjs",
129
+ "./utils/guards": "./dist/utils__guards.mjs",
108
130
  "./utils/hash-content": "./dist/utils__hash-content.mjs",
109
131
  "./utils/internal-error": "./dist/utils__internal-error.mjs",
110
132
  "./utils/json": "./dist/utils__json.mjs",
@@ -114,7 +136,9 @@
114
136
  "./utils/simplify-deep": "./dist/utils__simplify-deep.mjs",
115
137
  "./utils/structured-error": "./dist/utils__structured-error.mjs",
116
138
  "./utils/suppress-idle-connection-errors": "./dist/utils__suppress-idle-connection-errors.mjs",
139
+ "./utils/text": "./dist/utils__text.mjs",
117
140
  "./utils/types": "./dist/utils__types.mjs",
141
+ "./utils/upgrade-guides": "./dist/utils__upgrade-guides.mjs",
118
142
  "./value": "./dist/value.mjs",
119
143
  "./value/mongodb-types": "./dist/value__mongodb-types.mjs",
120
144
  "./vite-plugin-contract-emit": "./dist/vite-plugin-contract-emit.mjs",
@@ -10,13 +10,13 @@ description: >-
10
10
  such as MIGRATION.HASH_MISMATCH. Use when the user asks "what is Prisma
11
11
  8", "where do I start", or compares it to another ORM. Use when the user
12
12
  asks to upgrade or bump Prisma 8 in an app or an extension package. Use when
13
- you see @internal/* or @prisma/orm-* imports, prisma.config.ts with
13
+ you see @prisma/orm-* imports, prisma.config.ts with
14
14
  definePrismaConfig, or contract.json / contract.d.ts. Do not use for Prisma
15
15
  ORM 7 or earlier (schema.prisma + @prisma/client).
16
16
  metadata:
17
17
  library: '@prisma/orm-mongo'
18
- library_version: '8.0.0-rc.9-dev.12'
19
- version: '2026-09-11'
18
+ library_version: '8.0.1-dev.1'
19
+ version: '2026-09-12'
20
20
  ---
21
21
 
22
22
  # Prisma 8 (Prisma 8)
@@ -27,13 +27,17 @@ Prisma 8 moves fast, and your training data about it is very likely outdated. Th
27
27
 
28
28
  ## Pre-conditions
29
29
 
30
- Check these before acting on anything below. Halt on the first one that fails and tell the user what is missing.
30
+ Check these before acting on anything below. Halt on the first one that fails and tell the user what is missing. Pre-conditions 1 and 3 describe an application that is already set up. Check only pre-condition 2 in a package that builds a target or is a Prisma extension, and when setting up a new project, which creates what 1 and 3 check.
31
31
 
32
- 1. **The project is on Prisma 8.** `prisma.config.ts` exports `definePrismaConfig({ orm: ... })`, and `package.json` depends on `@prisma/orm-postgres`, `@prisma/orm-sqlite`, or `@prisma/orm-mongo`. A project with `schema.prisma` and `@prisma/client` is Prisma 7 or earlier; this skill does not apply to it, and its instructions will break such a project.
33
- 2. **The skill matches the installed version.** Compare `metadata.library_version` in this file's frontmatter with the installed `@prisma/orm-*` version in `package.json`. If they differ, run `prisma skills sync` and re-read this file before continuing.
32
+ 1. **The project is on Prisma 8.** `prisma.config.ts` exports `definePrismaConfig({ orm: ... })`, and `package.json` depends on the package for its database: `@prisma/orm-postgres`, `@prisma/orm-mongo`, `@prisma/orm-sqlite`, `@prisma/orm-mysql`, `@prisma/orm-mariadb`, or another package that `prisma.config.ts` imports `defineConfig` from. A project with `schema.prisma` and `@prisma/client` is Prisma 7 or earlier; this skill does not apply to it, and its instructions will break such a project.
33
+ 2. **The skill matches the installed version.** Compare `metadata.library_version` in this file's frontmatter with the installed `@prisma/orm-*` version in `package.json`. If they differ, run `prisma skills sync` and re-read this file before continuing. If no `@prisma/orm-*` package is installed, as in a project not set up yet, this check passes.
34
34
  3. **The contract artefacts exist.** `contract.json` and `contract.d.ts` sit next to the contract source named by `prisma.config.ts`. If they are missing or older than the source, run `prisma contract emit` first; every query and migration instruction below assumes current artefacts.
35
35
 
36
- **Import paths in the references.** The reference files spell façade imports as `@internal/<target>/<subpath>` and `@internal/extension-<name>/<subpath>`. In an application those packages are published as `@prisma/orm-<target>/<subpath>` (`@prisma/orm-postgres/runtime`, `@prisma/orm-mongo/config`, `@prisma/orm-sqlite/runtime`) and `@prisma/orm-extension-<name>/<subpath>` (`@prisma/orm-extension-pgvector/control`). Write the `@prisma/orm-*` name in user code; the two spellings are the same package. Paths already written as `@prisma/orm-*` in the references are exact. The `metadata.library_version` in this file's frontmatter is the version it was published with; if it does not match the project's installed Prisma packages, run `prisma skills sync` and re-read.
36
+ **Import paths in the references.** The reference files name the published packages an application installs: `@prisma/orm-<target>/<subpath>` (`@prisma/orm-postgres/runtime`, `@prisma/orm-mongo/config`, `@prisma/orm-sqlite/runtime`) and `@prisma/orm-extension-<name>/<subpath>` (`@prisma/orm-extension-pgvector/control`). Some older per-transition instructions under `upgrading/` name a package by the Prisma repository's workspace name, which is not published; find the `@prisma/orm-*` entry that carries the same module before writing it into user code. The `metadata.library_version` in this file's frontmatter is the version it was published with; if it does not match the project's installed Prisma packages, run `prisma skills sync` and re-read.
37
+
38
+ ## Never reset or drop a database
39
+
40
+ Never reset or drop a database to fix a migration, marker or contract problem, and never propose it. A database can always be moved to the contract you want. When its migration history does not need to be kept (a local, development, staging or preview database), reconcile it with `prisma db update`. When it changes only through migrations, as production should, author the migrations that bring it there. The database's change policy, recorded in its marker, says which it is, and `db update` refuses one that permits only migrations; never edit a ref's `policies` or pass `--permit-policy-change` to get past that. A deploy that says there is no migration path, or `MIGRATION.MARKER_MISMATCH`, is covered in [`references/migrations.md`](references/migrations.md) § *A database whose marker is not in the migration graph*.
37
41
 
38
42
  Prisma 8 is a contract-first data layer. This skill routes every Prisma 8 task to the right reference file — open the reference before writing code; do not answer from this file alone.
39
43
 
@@ -45,7 +49,7 @@ Three steps the user does:
45
49
 
46
50
  1. **Edit your data contract.** ([`references/contract.md`](references/contract.md))
47
51
  2. **The system plans the migrations for you.** ([`references/migrations.md`](references/migrations.md))
48
- 3. **If you need data migrations, you edit `migration.ts` and execute it.** ([`references/migrations.md`](references/migrations.md))
52
+ 3. **If you need a data migration, you write a `dataTransform` in `migration.ts` and execute it.** Inserts, updates and deletes never go in a `rawSql` step. ([`references/migrations.md`](references/migrations.md))
49
53
 
50
54
  Everything else — queries, runtime wiring, build integration, debugging, feedback — sits on top of those three.
51
55
 
@@ -58,17 +62,18 @@ Open the reference whose triggers match the task. If more than one matches, open
58
62
  | Task | Reference | Triggers |
59
63
  | --- | --- | --- |
60
64
  | Adopt / set up / first steps | [`references/quickstart.md`](references/quickstart.md) | new project, existing database, "what can I do with Prisma 8", "where do I start", "just ran createprisma", `npx create-prisma`, first steps, first query, `prisma orm init` greenfield setup, `contract infer` + `db sign` brownfield adoption, connect-write-read first arc, day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `db migrate`, `db schema`, `db verify`), flags `--target` / `--authoring` / `--schema-path` / `--probe-db` / `--output` |
61
- | Edit the data contract | [`references/contract.md`](references/contract.md) | schema, models, fields, attributes, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` / `@@base`), extension namespaces (`pgvector.Vector(...)`, `postgis.Geometry(...)`), `prisma.config.ts` / `definePrismaConfig` / `ormConfig`, `prisma contract emit`, PSL, `contract.prisma`, `contract.ts`, `contract.json`, `contract.d.ts`, `@internal/postgres/config`, `@internal/postgres/contract-builder`, `@internal/mongo/config`, `extensions:`, pgvector, postgis, paradedb, Temporal / `temporal-polyfill` / `RUNTIME.TEMPORAL_UNAVAILABLE`, `@@control`, control policy (managed / tolerated / external / observed), soft delete, validations, callbacks |
62
- | Author migrations | [`references/migrations.md`](references/migrations.md) | `db update` vs `migration plan`, `db migrate`, `migration new`, `migration show`, `db update --dry-run`, `db verify`, `db sign`, data migration, `dataTransform`, placeholder sentinels in framework-rendered `migration.ts`, `MIGRATION.HASH_MISMATCH`, `MIGRATION.UNFILLED_PLACEHOLDER`, `MIGRATION.DESTRUCTIVE_CHANGES` / `--confirm <database>`, schema drift |
63
- | Migration graph, refs, plan origin | [`references/migration-model.md`](references/migration-model.md) | migration graph, refs, `migration ref set` / `list` / `delete`, the `db` ref, `--advance-ref`, `migration plan --from`, `from: (baseline)` in plan output, greenfield / from-scratch plan, baseline, first migration before deploy (Composer / CD-managed databases), chaining migrations, retrofitting migrations onto an existing database, `MIGRATION.HASH_NOT_IN_GRAPH`, `MIGRATION.PATH_UNREACHABLE` at plan/chain time |
64
- | Review migrations on deploy | [`references/migration-review.md`](references/migration-review.md) | "what migrations are going to run", "what runs on deploy / merge", merge conflict, diamond convergence, concurrent migrations, migration status, ref management for CI, staging / production environment refs, `MIGRATION.MARKER_NOT_IN_HISTORY`, `MIGRATION.MISSING_INVARIANTS`, `MIGRATION.AMBIGUOUS_TARGET`, `db migrate --show` |
65
- | Write queries | [`references/queries.md`](references/queries.md) | query, where, select, project, orderBy, limit, offset, take, skip, include, lookup, first, all, count, aggregate, groupBy, create, update, delete, upsert, returning, transaction, `db.orm`, `db.sql`, `runtime.query(plan)` vs `runtime.execute(plan)`, `db.prepare` / prepared statements, streaming / `for await`, many-to-many `include` and nested `connect`, `and` / `or` / `not` from `@prisma/orm-postgres/orm-client`, `db.query.from(...)` (Mongo pipeline), namespace-aware accessors, `.all()` Thenable, single-use iterators (`RUNTIME.ITERATOR_CONSUMED`), target-declared aggregate types (`count`, integer `sum`, and integer `avg` are `number`; `count` and integer `sum` throw outside ±(2^53 − 1) rather than round, while `avg` is a fraction already and carries no guard; `countBigInt` / `sumBigInt` / `avgDecimal` are the lossless forms, `avgDecimal` on PostgreSQL only), drizzle-style, kysely-style. Naming types (§ *Naming model and result types*): "type of my model", "return type of a query", `ResultType`, `Scalars`, `Shape`, `models` / `Models` namespace in `contract.d.ts`, `Models.public_User`, Prisma 7 `Prisma.User` / `GetPayload` / `UserGetPayload` equivalents. Postgres/SQLite specifics: [`references/queries-postgres.md`](references/queries-postgres.md); Mongo specifics: [`references/queries-mongo.md`](references/queries-mongo.md) |
66
- | Wire the runtime | [`references/runtime.md`](references/runtime.md) | `db.ts`, `postgres<Contract>(...)` / `sqlite<Contract>(...)` / `mongo<Contract>(...)` façades, middleware composition (lints, budgets, cache via `@prisma/orm-extension-middleware-cache`, custom `afterQuery` middleware, `@prisma/orm-postgres/family-runtime`), `DATABASE_URL`, `.env`, connection pool / `poolOptions`, dev vs prod config, transactions, read replicas, multi-database, script won't exit / hangs, `db.close` / `pool.end`, `await using` / `[Symbol.asyncDispose]` |
67
- | Build-tool integration | [`references/build.md`](references/build.md) | Vite plugin (`@internal/vite-plugin-contract-emit`, Vite 7/8), `vite.config.ts`, contract emit on save, HMR / dev server, Next.js / Webpack / esbuild / Rollup / Turbopack (named gaps, not fabricated) |
68
- | Supabase | [`references/supabase.md`](references/supabase.md) | `@internal/extension-supabase`, RLS, row level security, policies (`policy_select` / `policy_update` / `@@rls`, `auth.uid()`), role binding (`asUser(jwt)` / `asAnon()` / `asServiceRole()`), `auth.users`, cross-space FKs to `supabase:auth.AuthUser`, JWT / JWKS (`SUPABASE_JWKS_URL`, `SUPABASE_JWT_SECRET`), `SUPABASE.JWT_INVALID`, `SUPABASE.CONFIG_INVALID`, `RoleBoundDb`, session pooler |
69
- | Debug an error | [`references/debug.md`](references/debug.md) | any structured error envelope (code, severity, why, fix, nextActions, meta), emit failed, query won't typecheck, query crashed, migration won't apply, `MIGRATION.HASH_MISMATCH`, `MIGRATION.RUNNER_FAILED`, `BUDGET.ROWS_EXCEEDED`, `BUDGET.TIME_EXCEEDED`, `RUNTIME.ABORTED`, `RUNTIME.TEMPORAL_UNAVAILABLE`, `PLAN.HASH_MISMATCH`, `CONTRACT.MARKER_MISSING`, `CONFIG.*` / `CLI.*` / `CONTRACT.*` / `MIGRATION.*` / `ORM.*` / `RUNTIME.*` codes, legacy `PN-*` codes, exit code 4 findings, drift, capability missing, planner conflict, EXPLAIN, query log, script won't exit / close connection |
70
- | Upgrade Prisma in an app | [`references/upgrade-app.md`](references/upgrade-app.md) | "upgrade Prisma", "upgrade Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", `@internal/*` version bump in an application, per-transition upgrade instructions in [`upgrading/app/upgrades/`](upgrading/app/upgrades/), extension-pin pre-flight, `PN-UPGRADE-*` |
71
- | Upgrade Prisma in an extension | [`references/upgrade-extension.md`](references/upgrade-extension.md) | the same request in a package that *is* a Prisma extension (`@internal/contract` / SPI dependency, `^@.*/extension-` name), `prisma-8-check-pins`, exact-pin rule, per-transition instructions in [`upgrading/extension/upgrades/`](upgrading/extension/upgrades/) |
65
+ | Edit the data contract | [`references/contract.md`](references/contract.md) | schema, models, fields, attributes, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` / `@@base`), extension namespaces (`pgvector.Vector(...)`, `postgis.Geometry(...)`), `prisma.config.ts` / `definePrismaConfig` / `ormConfig`, `prisma contract emit`, PSL, `contract.prisma`, `contract.ts`, `contract.json`, `contract.d.ts`, `@prisma/orm-postgres/config`, `@prisma/orm-postgres/contract-builder`, `@prisma/orm-mongo/config`, `extensions:`, pgvector, postgis, Temporal / `temporal-polyfill` / `RUNTIME.TEMPORAL_UNAVAILABLE`, `@@control`, control policy (managed / tolerated / external / observed), soft delete, validations, callbacks |
66
+ | Author migrations | [`references/migrations.md`](references/migrations.md) | "no migration path", "migration path not found", "no authored path", `MIGRATION.MARKER_MISMATCH`, `MIGRATION.CHANGE_POLICY_FORBIDS`, `MIGRATION.DATA_PROTECTION_FORBIDS`, `MIGRATION.POLICY_MISMATCH`, change policy, data protection policy, `migration ref policy show` / `set` / `delete`, declaring a ref's policies, `--permit-policy-change`, "reset the database", "drop the database", `db update` vs `migration plan`, `db migrate`, `migration new`, `migration show`, `db update --dry-run`, `db verify`, `db sign`, data migration, `dataTransform`, placeholder sentinels in framework-rendered `migration.ts`, `MIGRATION.HASH_MISMATCH`, `MIGRATION.UNFILLED_PLACEHOLDER`, data-loss questions (`--delete`, `--rename`, `--allow`, `CLI.CONSENT_REQUIRED`), schema drift |
67
+ | Migration graph, refs, plan origin | [`references/migration-model.md`](references/migration-model.md) | migration graph, refs, `migration ref set` / `list` / `delete`, the `db` ref, `--advance-ref`, `--no-advance-ref`, `migration plan --from`, `from: (baseline)` in plan output, greenfield / from-scratch plan, baseline, first migration before deploy (Composer / CD-managed databases), chaining migrations, retrofitting migrations onto an existing database, `MIGRATION.HASH_NOT_IN_GRAPH`, `MIGRATION.PATH_UNREACHABLE` at plan/chain time |
68
+ | Review migrations on deploy | [`references/migration-review.md`](references/migration-review.md) | "what migrations are going to run", "what runs on deploy / merge", merge conflict, diamond convergence, concurrent migrations, migration status, ref management for CI, staging / production environment refs, `MIGRATION.MARKER_NOT_IN_HISTORY`, `MIGRATION.MISSING_INVARIANTS`, `db migrate --show` |
69
+ | Write queries | [`references/queries.md`](references/queries.md) | query, where, select, project, orderBy, limit, offset, take, skip, include, lookup, first, all, count, aggregate, groupBy, create, update, delete, upsert, returning, transaction, `db.orm`, `db.sql`, `runtime.query(plan)` vs `runtime.execute(plan)`, `db.prepare` / prepared statements, streaming / `for await`, many-to-many `include` and nested `connect`, `and` / `or` / `not` from `@prisma/orm-postgres/orm-client`, `db.query.from(...)` (Mongo pipeline), namespace-aware accessors, `.all()` Thenable, single-use iterators (`RUNTIME.ITERATOR_CONSUMED`), target-declared aggregate types (`count`, integer `sum`, and integer `avg` are `number`; `count` and integer `sum` throw outside ±(2^53 − 1) rather than round, while `avg` is a fraction already and carries no guard; `countBigInt` / `sumBigInt` / `avgDecimal` are the lossless forms, `avgDecimal` on PostgreSQL only), custom collection class (`extends Collection`), `with` and query fragments (`QueryFragment`, `Filtered`, `Ordered`), shared query fragments and scopes (`db.orm.fragment(fields, body)` for a filter on every model with given fields, `CodecField`, `db.orm.public.Post.fragment(...)` for a shared `select` / `include`, `orderByField` for an order or sort parameter from a request), drizzle-style, kysely-style. Naming types (§ *Naming model and result types*): "type of my model", "return type of a query", `ResultType`, `Scalars`, `Shape`, `models` / `Models` namespace in `contract.d.ts`, `Models.public_User`, Prisma 7 `Prisma.User` / `GetPayload` / `UserGetPayload` equivalents. Postgres/SQLite specifics: [`references/queries-postgres.md`](references/queries-postgres.md); Mongo specifics: [`references/queries-mongo.md`](references/queries-mongo.md) |
70
+ | Wire the runtime | [`references/runtime.md`](references/runtime.md) | `db.ts`, `contractFromJson<Contract>(...)`, `postgres({ contract })` / `sqlite({ contract })` / `mongo({ contract })` clients, middleware composition (lints, budgets, cache via `@prisma/orm-extension-middleware-cache`, custom `activityEnded` middleware, `@prisma/orm-postgres/family-runtime`), `DATABASE_URL`, `.env`, connection pool / `poolOptions`, dev vs prod config, transactions, read replicas, multi-database, script won't exit / hangs, `db.close` / `pool.end`, `await using` / `[Symbol.asyncDispose]` |
71
+ | Build-tool integration | [`references/build.md`](references/build.md) | Vite plugin (`@prisma/orm-<target>/vite-plugin-contract-emit`, Vite 7/8), `vite.config.ts`, contract emit on save, HMR / dev server, Next.js / Webpack / esbuild / Rollup / Turbopack (named gaps, not fabricated) |
72
+ | Supabase | [`references/supabase.md`](references/supabase.md) | `@prisma/orm-extension-supabase`, RLS, row level security, policies (`policy_select` / `policy_update` / `@@rls`, `auth.uid()`), role binding (`asUser(jwt)` / `asAnon()` / `asServiceRole()`), `auth.users`, cross-space FKs to `supabase:auth.AuthUser`, JWT / JWKS (`SUPABASE_JWKS_URL`, `SUPABASE_JWT_SECRET`), `SUPABASE.JWT_INVALID`, `SUPABASE.CONFIG_INVALID`, `RoleBoundDb`, session pooler |
73
+ | Debug an error | [`references/debug.md`](references/debug.md) | any structured error envelope (code, severity, why, fix, nextActions, meta), emit failed, query won't typecheck, query crashed, migration won't apply, `MIGRATION.HASH_MISMATCH`, `MIGRATION.SCHEMA_VERIFY_FAILED`, `MIGRATION.PRECHECK_FAILED`, `BUDGET.ROWS_EXCEEDED`, `BUDGET.TIME_EXCEEDED`, `RUNTIME.ABORTED`, `RUNTIME.TEMPORAL_UNAVAILABLE`, `PLAN.HASH_MISMATCH`, `CONTRACT.MARKER_MISSING`, `CONFIG.*` / `CLI.*` / `CONTRACT.*` / `MIGRATION.*` / `ORM.*` / `RUNTIME.*` codes, legacy `PN-*` codes, exit code 4 findings, drift, capability missing, planner conflict, EXPLAIN, query log, script won't exit / close connection |
74
+ | Upgrade Prisma in an app | [`references/upgrade-app.md`](references/upgrade-app.md) | "upgrade Prisma", "upgrade Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", `@prisma/orm-*` version bump in an application, per-transition upgrade instructions in [`upgrading/app/upgrades/`](upgrading/app/upgrades/), extension-pin pre-flight, `PN-UPGRADE-*` |
75
+ | Upgrade Prisma in an extension | [`references/upgrade-extension.md`](references/upgrade-extension.md) | the same request in a package that *is* a Prisma extension (`@prisma/orm-framework` / SPI dependency, `^@.*/extension-` name), `prisma-8-check-pins`, exact-pin rule, per-transition instructions in [`upgrading/extension/upgrades/`](upgrading/extension/upgrades/) |
76
+ | Build the package for a new database | [`references/build-a-target-package.md`](references/build-a-target-package.md) | a new database target outside Prisma's repository, `prisma-orm-<name>`, `defineConfig` with `contract.typesModule` and `migrations.module`, `/contract-types`, `restateTypeDeclarations`, the `/init` entrypoint, `InitContribution`, `prisma orm init --target <package>`, `CONFIG.CONTRACT_TYPES_MODULE_MISSING`, `CONFIG.MIGRATION_MODULE_MISSING` |
72
77
  | File feedback / ask the team | [`references/feedback.md`](references/feedback.md) | bug report, file an issue, feature request, missing feature, capability gap, "this is broken", surprising behaviour, Q&A / design discussion, ask the Prisma team, Prisma Discord (pris.ly/discord), extension-author questions |
73
78
 
74
79
  ## Routing rules
@@ -0,0 +1,117 @@
1
+ # Build the package for a new database
2
+
3
+ This reference is for the author of a package that adds a database target to Prisma 8, outside Prisma's repository. An application installs the package, imports `defineConfig` from it in `prisma.config.ts`, and runs `prisma orm init --target <your package>` and `prisma contract emit` exactly as an application on `@prisma/orm-postgres` does. Prisma's own database packages use the mechanisms below, with no path an outside package lacks.
4
+
5
+ `prisma-orm-acmedb` stands for your package throughout.
6
+
7
+ ## What the package exports
8
+
9
+ | Entrypoint | Holds | Needed for |
10
+ | --- | --- | --- |
11
+ | `/config` | `defineConfig`, which names the two modules below | every command |
12
+ | `/contract-types` | the types a generated `contract.d.ts` imports | `prisma contract emit` |
13
+ | `/migration` | the migration base class, the command-line entry and your operation helpers | `prisma migration plan` |
14
+ | `/init` | the init contribution | `prisma orm init` |
15
+ | `/runtime` | your client factory | the application's `db.ts` |
16
+
17
+ `/contract-builder` (the TypeScript contract builder bound to your target) and `/control` (a client for scripts) are conventions Prisma's packages follow. The Postgres package is the reference for all of these: `packages/3-targets/postgres/` in the prisma/orm repository, whose `9-facade` folder is the package applications install.
18
+
19
+ ## Generated files import from your package
20
+
21
+ An application can import only from packages it depends on directly, which is your package and not the ones it is built from. So the config your `defineConfig` returns names the modules generated files import from:
22
+
23
+ ```ts
24
+ // src/config.ts
25
+ import { defineConfig as defineFrameworkConfig } from '@prisma/orm-framework/config/config-types';
26
+ import { adapter, driver, family, migrationModule, target, typesModule } from './components';
27
+
28
+ export function defineConfig(options: AcmeConfigOptions) {
29
+ return defineFrameworkConfig({
30
+ family,
31
+ target,
32
+ adapter,
33
+ driver,
34
+ contract: { ...contractSource(options), typesModule },
35
+ migrations: { ...options.migrations, module: migrationModule },
36
+ });
37
+ }
38
+ ```
39
+
40
+ - **`contract.typesModule`** is your `/contract-types` module. It only re-exports: the framework's contract types, the family's, and your target's codec and operation types.
41
+
42
+ ```ts
43
+ // src/contract-types.ts
44
+ export type * from '@prisma/orm-framework/contract/types';
45
+ export type * from '@prisma/orm-family-sql/contract/types';
46
+ export type * from './codec-types';
47
+ export type * from './operation-types';
48
+ ```
49
+
50
+ - **`migrations.module`** is your `/migration` module. A migration plan's `renderTypeScript(migrationModule)` receives it; write every import of a rendered `migration.ts` from it, and name no module in the renderer itself. Export `placeholder` from it under that name, so `prisma db migrate` can refuse an unfilled migration.
51
+ - **Your target's and adapter's type declarations name your types module.** When the descriptors live in another package of yours, hand the config copies that do: `restateTypeDeclarations(descriptor, typesModule)` from `@prisma/orm-framework/target-package-config/type-declarations`.
52
+ - **Assemble the components in one file** and build both `defineConfig` and any control client from it, so a command and a script are given the same components.
53
+
54
+ A config that names neither module stops with `CONFIG.CONTRACT_TYPES_MODULE_MISSING` or `CONFIG.MIGRATION_MODULE_MISSING`. A module is named the way a package is imported: a path or a URL is refused, because generated files are written into more than one folder.
55
+
56
+ ## `prisma orm init` writes the project from your package
57
+
58
+ `init` checks that your package lists the `prisma-orm-extension` keyword (see *Package rules*), installs it, loads the default export of its `/init` entrypoint, and writes the project from it:
59
+
60
+ ```ts
61
+ // src/init.ts
62
+ import type { InitContribution } from '@prisma/orm-toolchain/cli/init-contribution';
63
+
64
+ export default {
65
+ label: 'AcmeDB',
66
+ configModule: 'prisma-orm-acmedb/config',
67
+ peerPackages: ['acmedb-driver'],
68
+ authoringModes: ['psl', 'typescript'],
69
+ starterContract: (mode) => (mode === 'psl' ? starterPsl : starterTs),
70
+ contractSample: (mode) => (mode === 'psl' ? samplePsl : sampleTs),
71
+ databaseFile: () => dbFile,
72
+ envExample: () => 'DATABASE_URL="acmedb://user:password@localhost:5000/mydb"\n',
73
+ quickReference: (input) => renderQuickReference(input),
74
+ serverRequirement: { minVersion: ACMEDB_MIN_SERVER_VERSION, checkCommand: 'SELECT version()' },
75
+ probe: (databaseUrl, signal) => probeAcmeDb(databaseUrl, signal),
76
+ } satisfies InitContribution;
77
+ ```
78
+
79
+ | Member | What `init` does with it |
80
+ | --- | --- |
81
+ | `label` | Shows it as the target's name |
82
+ | `configModule` | Writes `prisma.config.ts` importing `defineConfig` from it |
83
+ | `peerPackages` | Installs these driver packages into the application, after the questions |
84
+ | `authoringModes` | Offers these ways to write the contract; a mode you do not list is refused |
85
+ | `starterContract(mode)`, `contractSample(mode)` | Writes the starter contract, and shows the sample in the quick reference |
86
+ | `databaseFile()` | Writes `db.ts`, beside the emitted `contract.json` and `contract.d.ts` |
87
+ | `envExample()` | Writes `.env.example`, and `.env` when the user asks for one |
88
+ | `quickReference(input)` | Writes the getting-started document |
89
+ | `readme(input)` | Optional. Writes a README in a project that already has `src/index.ts` |
90
+ | `serverRequirement` | Optional. States the minimum server version in the quick reference |
91
+ | `probe(databaseUrl, signal)` | Optional. Runs for `--probe-db` |
92
+ | `prisma7QuickReference(input)` | Optional. Required when your `configModule` exports `prisma7Schema` |
93
+
94
+ A user names your package in `--target` by its package name, such as `--target prisma-orm-acmedb`. Short names such as `postgres` exist only for the packages in the CLI's list of targets Prisma vouches for; today that is Postgres and MongoDB. With `--skip-install`, your package must already be installed in the project: `init` loads your `/init` entrypoint before it writes anything, and reads the `prisma-orm-extension` keyword from the installed copy.
95
+
96
+ Rules:
97
+
98
+ - **No framework code runs in `/init`.** Types are fine. The CLI that loads it may be a different installed copy of the framework from the one your package depends on, and two copies in one process do not recognise each other's values.
99
+ - **The connection string is `DATABASE_URL`.** `prisma.config.ts`, `db.ts` and `--probe-db` read it, and `dotenv` is installed with your package, so `db.ts` may import `dotenv/config`. `--probe-db` reads it from the shell's environment, not from `.env`.
100
+ - **Drivers.** The first install is your package and `dotenv`; the package manager handles your package's required peers its own way, and a configuration that refuses a package without its peers makes that install fail, which `init` reports. `init` then installs the required peers your manifest declares, before it loads `/init`, and reads `peerPackages` after. Declare your driver as a required peer dependency, and list it in `peerPackages` too.
101
+ - **`/init` loads without the driver.** A driver your manifest does not declare as a required peer is installed only after `/init` is loaded, so import the driver inside `probe`, when it runs, and report `driver-missing` if that import fails.
102
+ - **The probe** resolves to the server's version, `driver-missing`, `driver-failed`, or `version-unreadable` once connected, and rejects only when it cannot connect. Bound its connect and query with your driver's own timeouts. `init` aborts `signal` after 60 seconds; close your client when it fires.
103
+
104
+ ## Package rules
105
+
106
+ - Name the package `prisma-orm-<name>`, under your scope if you have one, and add the keyword `prisma-orm-extension` to its `package.json`. The keyword is required: `prisma orm init --target` reads it before installing your package and refuses a package without it. `init` checks the copy it is about to load: the registry's `latest` version when it will install your package, and the installed `package.json` when it will not: under `--skip-install`, or when the project already declares your package and has it on disk. It asks the registry without credentials, so a user of a package on a registry that needs them, or on a scope's own registry, installs the package first and then runs `init`.
107
+ - List every Prisma package that your code or its type declarations use as a peer dependency, and again as a development dependency, so that your own build and tests install them. That means `@prisma/orm-framework`, your family's package, and `@prisma/orm-toolchain`, whose `InitContribution` type your `/init` entrypoint uses. None of them is an ordinary dependency: an ordinary dependency at a different version from the application's gives the application a second copy.
108
+ - **Which version or range to list.** Until release 8.0, the exact `8.0.0-rc.N` the application uses. From release 8.0, a caret on each GA package of ours, such as `^8.1.0`, and a tilde on one below GA, such as `~8.1.0-preview.0`. Number your own package by the first Prisma release it works with. [`upgrade-extension.md`](upgrade-extension.md#from-release-80-number-your-package-and-declare-ranges) § *From release 8.0* has the full rules, and § *Exact-pin rule* explains the rule until release 8.0.
109
+ - **List everything an application must install as a required peer dependency.** `prisma orm init` reads your package's `peerDependencies` and adds every required one to the application, at the version or range you give. That covers the `@prisma/orm-*` packages you list, and every other package that your `peerDependenciesMeta` does not mark optional, including your driver. You do not have to list the peer dependencies of the `@prisma/orm-*` packages yourself: `init` reads those from the packages.
110
+ - **Your driver is installed once.** `peerPackages` in your init contribution still names your driver, and `init` installs that too. A driver that is also a required peer dependency is not installed twice.
111
+ - Import or name no module beginning `@internal/`. Those are Prisma's private workspace names.
112
+
113
+ ## Check it from outside
114
+
115
+ Pack your package and install the tarball into a scratch application that depends on nothing from Prisma except the CLI. Run `prisma orm init --target <your package>`, `prisma contract emit` and `prisma migration plan`, then typecheck with `skipLibCheck` off. Every import in the generated files names your package, an extension's own package, or a relative path.
116
+
117
+ A check with a package that borrows another target's parts behind its own name proves only the wiring: the imports and `init`. A target written from scratch also needs its own target, adapter and driver descriptors, its own codec and operation types under its own module names, its own migration planner and renderer, and its own contract serialiser and runtime client.
@@ -3,9 +3,9 @@
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- This skill covers Prisma 8's build-tool plugins — the dev-server / build-system integrations that re-emit contract artifacts automatically as the user edits the contract source. Today that's [`@internal/vite-plugin-contract-emit`](https://github.com/prisma/prisma/blob/main/packages/1-framework/3-tooling/vite-plugin-contract-emit/README.md) for Vite 7 and Vite 8. Next.js, Webpack, esbuild, Rollup, and Turbopack plugins are documented under *What Prisma 8 doesn't do yet* with the workaround.
6
+ This skill covers Prisma 8's build-tool plugins — the dev-server / build-system integrations that re-emit contract artifacts automatically as the user edits the contract source. Today that's the Vite plugin for Vite 7 and Vite 8, `prismaVitePlugin`, which the database package exports from its `vite-plugin-contract-emit` entry (`@prisma/orm-postgres/vite-plugin-contract-emit`, `@prisma/orm-sqlite/vite-plugin-contract-emit`, `@prisma/orm-mongo/vite-plugin-contract-emit`, and the same for MySQL and MariaDB). Next.js, Webpack, esbuild, Rollup, and Turbopack plugins are documented under *What Prisma 8 doesn't do yet* with the workaround.
7
7
 
8
- **If the project is using Vite and consuming the contract, install the plugin.** There's no good reason not to — manual `prisma contract emit` during dev is friction the plugin eliminates. The agent should proactively offer the plugin whenever it sees a `vite.config.ts` in the project; the user doesn't need to ask.
8
+ **If the project is using Vite and consuming the contract, use the plugin.** There's no good reason not to — manual `prisma contract emit` during dev is friction the plugin eliminates. The agent should proactively offer the plugin whenever it sees a `vite.config.ts` in the project; the user doesn't need to ask.
9
9
 
10
10
  ## When to Use
11
11
 
@@ -24,25 +24,21 @@ This skill covers Prisma 8's build-tool plugins — the dev-server / build-syste
24
24
 
25
25
  - **The plugin's job is `contract emit`, on a schedule the bundler knows about.** It is *not* a runtime concern — at runtime, the application reads `contract.json` / `contract.d.ts` the same way whether the plugin emitted them or a script did. The plugin saves you the manual command during development.
26
26
  - **Vite 7 and Vite 8 only.** Peer range `^7.0.0 || ^8.0.0`. Vite 6 is not on the support matrix.
27
- - **`executeContractEmit` is the canonical publish path.** Custom plugins for other bundlers must also call it — never re-implement the load → emit → publish dance. The atomic-rename invariant (`contract.d.ts` renamed before `contract.json`) and the per-output FIFO queue live in `@internal/cli/control-api`.
27
+ - **Emission goes through the CLI's own publish path.** The Vite plugin and `prisma contract emit` both call `executeContractEmit`, which renames `contract.d.ts` before `contract.json` and queues writes per output. Never re-implement emission by writing the artefacts yourself; run `prisma contract emit` instead. No database package re-exports `executeContractEmit` (see *What Prisma 8 doesn't do yet*).
28
28
  - **No build-time / production emission.** The Vite plugin runs in `vite dev` only. For `vite build` / production, run `prisma contract emit` from a `prebuild` script.
29
29
 
30
30
  ## Workflow — Vite (the supported path)
31
31
 
32
- ### 1. Install the plugin
32
+ ### 1. Have the plugin
33
33
 
34
- ```bash
35
- pnpm add -D @internal/vite-plugin-contract-emit
36
- ```
37
-
38
- (Or `npm install --save-dev`, `yarn add -D`, `bun add -d` — use what the project's package manager is.)
34
+ The plugin ships inside the database package the project already depends on (`@prisma/orm-postgres`, `@prisma/orm-sqlite`, `@prisma/orm-mysql`, `@prisma/orm-mariadb` or `@prisma/orm-mongo`), so there is nothing to install besides Vite itself.
39
35
 
40
36
  ### 2. Wire `vite.config.ts`
41
37
 
42
38
  ```typescript
43
39
  // vite.config.ts
44
40
  import { defineConfig } from 'vite';
45
- import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';
41
+ import { prismaVitePlugin } from '@prisma/orm-postgres/vite-plugin-contract-emit';
46
42
 
47
43
  export default defineConfig({
48
44
  plugins: [prismaVitePlugin('prisma.config.ts')],
@@ -96,7 +92,7 @@ The Vite plugin is compatible with `@react-router/dev/vite`. Both plugins are li
96
92
 
97
93
  ```typescript
98
94
  import { reactRouter } from '@react-router/dev/vite';
99
- import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';
95
+ import { prismaVitePlugin } from '@prisma/orm-postgres/vite-plugin-contract-emit';
100
96
 
101
97
  export default defineConfig({
102
98
  plugins: [
@@ -115,12 +111,12 @@ See [`examples/react-router-demo`](https://github.com/prisma/prisma/tree/main/ex
115
111
  3. **The plugin warns: *"watching only the config; loader resolved inputs unavailable."*** The plugin couldn't resolve `contract.source.inputs` from the loader. The fallback watches only `prisma.config.ts` itself, so contract edits won't re-emit. Causes: the config file throws during loading; the contract source path resolves outside the Vite root. Fix the config error first, then check that the contract source path in the config is relative to (or inside) the Vite root.
116
112
  4. **Expecting `vite build` to re-emit.** It doesn't. Add a `prebuild` script.
117
113
  5. **Emit errors during dev**: the plugin surfaces them via Vite's error overlay. Read the overlay; the underlying cause is a contract authoring problem — chain to `references/debug.md` for resolution (PSL syntax, missing namespace, conflicting extensions).
118
- 6. **Re-installing dependencies without the plugin's peer-range move.** When PN bumps the plugin's peer range, you must re-run `pnpm install` so the lockfile picks up the new range. A stale lockfile keeps the old plugin and produces confusing version mismatch warnings.
114
+ 6. **Re-installing dependencies without the plugin's peer-range move.** When a Prisma 8 release changes the plugin's peer range, you must re-run `pnpm install` so the lockfile picks up the new range. A stale lockfile keeps the old plugin and produces confusing version mismatch warnings.
119
115
 
120
116
  ## What Prisma 8 doesn't do yet
121
117
 
122
- - **Next.js plugin.** No first-party `@internal/next-plugin-*` exists. Workaround: run `prisma contract emit` from a `prebuild` script in `package.json` and run it manually during development when the contract changes. Many Next.js projects also run a dev-time `tsx --watch` against a small script that calls the CLI on contract-source change. If you want a first-party Next.js plugin, file a feature request via the `references/feedback.md` skill.
123
- - **Webpack, esbuild, Rollup, Turbopack plugins.** None exist yet as first-party. Workaround: the canonical `executeContractEmit` surface lives in `@internal/cli/control-api` — a small per-bundler plugin can call it from the bundler's prebuild hook, but PN doesn't ship one for you. The `vite-plugin-contract-emit` source is the reference implementation if you want to write one yourself. If you want a first-party plugin for your bundler, file a feature request via the `references/feedback.md` skill.
118
+ - **Next.js plugin.** No first-party Next.js plugin exists. Workaround: run `prisma contract emit` from a `prebuild` script in `package.json` and run it manually during development when the contract changes. Many Next.js projects also run a dev-time `tsx --watch` against a small script that calls the CLI on contract-source change. If you want a first-party Next.js plugin, file a feature request via the `references/feedback.md` skill.
119
+ - **Webpack, esbuild, Rollup, Turbopack plugins.** None exist yet as first-party. `executeContractEmit`, the function the Vite plugin calls, is exported only by the platform package `@prisma/orm-toolchain` (`cli/control-api`), and no database package re-exports it; application code imports only from its database package and extension packs, never from a platform package, even though `package.json` lists the platform packages; so do not build a plugin on it. Workaround: run `prisma contract emit` from the bundler's prebuild step (or a `prebuild` script in `package.json`), and rerun it when the contract changes during development. If you want a first-party plugin for your bundler, or a public entry for contract emission, file a feature request via the `references/feedback.md` skill.
124
120
  - **`vite build` integration.** The plugin runs in `vite dev` only. Workaround: a `prebuild` script that runs `prisma contract emit`. If you want the plugin to also run during `vite build`, file a feature request via the `references/feedback.md` skill.
125
121
  - **Vite 6 or earlier.** Not on the support matrix. Workaround: upgrade Vite to 7 or 8. If you have a hard reason to stay on Vite 6, file a feature request via the `references/feedback.md` skill.
126
122
 
@@ -138,5 +134,5 @@ See [`examples/react-router-demo`](https://github.com/prisma/prisma/tree/main/ex
138
134
  - [ ] Editing the contract source triggers a re-emit log line.
139
135
  - [ ] `prebuild` script (or equivalent) runs `prisma contract emit` for CI / production builds.
140
136
  - [ ] No `vite build` expectation that the plugin will run.
141
- - [ ] For non-Vite bundlers: surfaced the *What PN doesn't do yet* entry and routed the user to `references/feedback.md` if they want first-party support.
142
- - [ ] Did NOT confabulate a `@internal/next-plugin-contract-emit` package or any other bundler-specific plugin that doesn't exist.
137
+ - [ ] For non-Vite bundlers: surfaced the *What Prisma 8 doesn't do yet* entry and routed the user to `references/feedback.md` if they want first-party support.
138
+ - [ ] Did NOT confabulate a Next.js plugin package or any other bundler-specific plugin that doesn't exist.