@prisma/orm-sqlite 8.0.0-rc.17-dev.29 → 8.0.0-rc.17-dev.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-sqlite",
3
- "version": "8.0.0-rc.17-dev.29",
3
+ "version": "8.0.0-rc.17-dev.31",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -10,17 +10,17 @@
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-sql": "8.0.0-rc.17-dev.29",
14
- "@prisma/orm-framework": "8.0.0-rc.17-dev.29",
15
- "@prisma/orm-target-sqlite": "8.0.0-rc.17-dev.29",
16
- "@prisma/orm-toolchain": "8.0.0-rc.17-dev.29",
13
+ "@prisma/orm-family-sql": "8.0.0-rc.17-dev.31",
14
+ "@prisma/orm-framework": "8.0.0-rc.17-dev.31",
15
+ "@prisma/orm-target-sqlite": "8.0.0-rc.17-dev.31",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.17-dev.31",
17
17
  "pathe": "^2.0.3",
18
18
  "tinyglobby": "^0.2.17"
19
19
  },
20
20
  "devDependencies": {
21
- "@internal/sqlite": "8.0.0-rc.17-dev.29",
22
- "@repo/tsconfig": "8.0.0-rc.17-dev.29",
23
- "@repo/tsdown": "8.0.0-rc.17-dev.29",
21
+ "@internal/sqlite": "8.0.0-rc.17-dev.31",
22
+ "@repo/tsconfig": "8.0.0-rc.17-dev.31",
23
+ "@repo/tsdown": "8.0.0-rc.17-dev.31",
24
24
  "tsdown": "0.22.14",
25
25
  "typescript": "5.9.3"
26
26
  },
@@ -15,7 +15,7 @@ description: >-
15
15
  ORM 7 or earlier (schema.prisma + @prisma/client).
16
16
  metadata:
17
17
  library: '@prisma/orm-sqlite'
18
- library_version: '8.0.0-rc.17-dev.29'
18
+ library_version: '8.0.0-rc.17-dev.31'
19
19
  version: '2026-09-12'
20
20
  ---
21
21
 
@@ -356,6 +356,46 @@ namespace public {
356
356
 
357
357
  Canonical worked example: `examples/supabase/src/contract.prisma`.
358
358
 
359
+ ## Workflow — Mixins (shared members)
360
+
361
+ The concept: a mixin is a named set of members for one kind of block. Declare it with the block's keyword followed by `mixin`, and include it in a block with `+<Name>`. The emitted contract is the same as if the mixin's members were written at the position of the inclusion.
362
+
363
+ ```prisma
364
+ model mixin Timestamps {
365
+ createdAt DateTime @default(now())
366
+ updatedAt DateTime @default(now())
367
+ @@index([createdAt])
368
+ }
369
+
370
+ enum mixin BaseRoles {
371
+ ADMIN = "admin"
372
+ USER = "user"
373
+ }
374
+
375
+ model User {
376
+ id Int @id
377
+ +Timestamps
378
+ email String
379
+ }
380
+
381
+ enum Role {
382
+ @@type("pg/text@1")
383
+ +BaseRoles
384
+ GUEST = "guest"
385
+ }
386
+ ```
387
+
388
+ `User` has the fields `id`, `createdAt`, `updatedAt`, `email`, in that order, and the index on `createdAt`. `Role` has the members `ADMIN`, `USER`, `GUEST`.
389
+
390
+ Rules:
391
+
392
+ - **One keyword per mixin.** A `model mixin` can be included only in models, a `type mixin` only in composite types, an `enum mixin` only in enums, and a mixin for a block an extension defines (for example `policy_select mixin`) only in blocks of that keyword.
393
+ - **A member provided twice is an error.** A field name or an enum member that the block already has, from its own body or from another mixin, is reported and the earlier one is kept. Including the same mixin twice in one block is also an error.
394
+ - **A mixin's attributes can name only its own fields.** `@@index([createdAt])` inside `Timestamps` works because `createdAt` is a field of the mixin. An attribute that needs a field of the including model belongs in that model; a model's own attributes can name the fields a mixin provides, as in `@@id([tenantId, id])`.
395
+ - **A mixin cannot include a mixin.**
396
+ - **Names follow namespaces.** A mixin declared in `namespace auth { ... }` is included from another namespace as `+auth.Timestamps`. The types of its fields are looked up from the mixin's namespace, not from the including block's.
397
+ - **A mixin is not a type.** It cannot be used as a field type, and it produces nothing in the contract unless a block includes it.
398
+
359
399
  ## Workflow — Cross-contract foreign keys
360
400
 
361
401
  The concept: a relation field can reference a model in another contract space using the `<space>:<namespace>.<Model>` form. The contract also supports top-level named-type aliases in a `types {}` block, backed by the same bare type-position constructors used by fields. The `@db.X(args)` channel is removed: rewrite `@db.X` as `X` and `@db.X(args)` as `X(args)`; remaining uses fail with an actionable diagnostic naming the replacement.