@sequenceholdings/orm 2.1.0 → 2.1.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.
- package/README.md +38 -1
- package/dist/authoring.cjs +1358 -45
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +223 -2
- package/dist/authoring.d.ts +223 -2
- package/dist/authoring.js +1349 -47
- package/dist/authoring.js.map +1 -1
- package/dist/canonical.cjs +662 -38
- package/dist/canonical.cjs.map +1 -1
- package/dist/canonical.d.cts +696 -53
- package/dist/canonical.d.ts +696 -53
- package/dist/canonical.js +647 -39
- package/dist/canonical.js.map +1 -1
- package/dist/cli.cjs +1808 -247
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1809 -248
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +90 -25
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +39 -22
- package/dist/client.d.ts +39 -22
- package/dist/client.js +87 -26
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +1325 -285
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +23 -2
- package/dist/compiler.d.ts +23 -2
- package/dist/compiler.js +1325 -285
- package/dist/compiler.js.map +1 -1
- package/dist/constants-YoFGjIBM.d.cts +99 -0
- package/dist/constants-YoFGjIBM.d.ts +99 -0
- package/dist/dynamic-input.d.cts +1 -0
- package/dist/dynamic-input.d.ts +1 -0
- package/dist/index.cjs +1605 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +230 -113
- package/dist/index.d.ts +230 -113
- package/dist/index.js +1583 -142
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +727 -38
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +539 -21
- package/dist/ir.d.ts +539 -21
- package/dist/ir.js +722 -39
- package/dist/ir.js.map +1 -1
- package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
- package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
- package/dist/policy-1iZbGnZZ.d.cts +24 -0
- package/dist/policy-1iZbGnZZ.d.ts +24 -0
- package/dist/predicate-v2.cjs +726 -42
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.d.cts +2 -1
- package/dist/predicate-v2.d.ts +2 -1
- package/dist/predicate-v2.js +726 -42
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +858 -54
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.d.cts +7 -3
- package/dist/sdl.d.ts +7 -3
- package/dist/sdl.js +856 -55
- package/dist/sdl.js.map +1 -1
- package/package.json +9 -4
- package/templates/orm-namespace/CLAUDE.md +6 -4
- package/templates/orm-namespace/codegen.preset.d.cts +7 -0
- package/templates/orm-namespace/codegen.ts +2 -1
- package/templates/orm-namespace/graphql/example/queries.ts +4 -3
- package/templates/orm-namespace/package.json +2 -1
- package/templates/orm-namespace/schema/tables.ts +3 -2
- package/templates/orm-namespace/sequence.config.ts +7 -11
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ branch on a namespace or product identity. See
|
|
|
16
16
|
Install the CLI and SDK together:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
pnpm add -g @sequenceholdings/studio-cli@0.
|
|
19
|
+
pnpm add -g @sequenceholdings/studio-cli@0.3.0 @sequenceholdings/orm@2.1.1
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Create a namespace project:
|
|
@@ -46,6 +46,29 @@ canonical metadata, snapshots, documents, and migration statements.
|
|
|
46
46
|
Commit generated outputs and migrations with the
|
|
47
47
|
source that produced them.
|
|
48
48
|
|
|
49
|
+
Owned `defineTable` contracts support named `checks` and referential actions
|
|
50
|
+
on enforced `toOne` links or composite `foreignKeys`:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
const reports = defineTable('reports', {
|
|
54
|
+
id: t.uuid().primaryKey(),
|
|
55
|
+
status: t.text().notNull(),
|
|
56
|
+
}, {
|
|
57
|
+
checks: [{ name: 'reports_status_check', expression: "status IN ('draft', 'active')" }],
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const runs = defineTable('runs', {
|
|
61
|
+
id: t.uuid().primaryKey(),
|
|
62
|
+
reportId: t.uuid().notNull(),
|
|
63
|
+
}, {
|
|
64
|
+
links: { report: toOne(reports, { on: 'reportId', enforce: true, onDelete: 'cascade' }) },
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Check expressions use a validated subset of PostgreSQL predicates. See
|
|
69
|
+
[database constraints](../../../docs/platform/orm-v2.md#database-integrity-constraints)
|
|
70
|
+
for the supported operators, actions, migration behavior, and limitations.
|
|
71
|
+
|
|
49
72
|
Use `apply --dry-run` to rehearse a migration against a disposable copy of the
|
|
50
73
|
target environment's data. `apply --no-create` refuses to provision a missing
|
|
51
74
|
namespace, which is useful for deployment checks.
|
|
@@ -115,3 +138,17 @@ This client rollout switch does not bypass server feature flags or authorization
|
|
|
115
138
|
- `@sequenceholdings/orm/drizzle` — supported Drizzle helpers for views
|
|
116
139
|
- `@sequenceholdings/orm/codegen` — GraphQL Code Generator preset used by a
|
|
117
140
|
scaffolded namespace
|
|
141
|
+
|
|
142
|
+
The `@sequenceholdings/orm/client` entry point contains the persisted-operation
|
|
143
|
+
executor and error types without importing compiler, migration, Node builtins,
|
|
144
|
+
or third-party runtime dependencies. It is safe to bundle into browser and
|
|
145
|
+
function applications. The Managed Functions SDK bundles this entry point so
|
|
146
|
+
deployed functions do not install ORM's authoring dependencies.
|
|
147
|
+
|
|
148
|
+
Use `createArtifactOrmExecutor` from `@sequenceholdings/artifact-studio` inside
|
|
149
|
+
an authenticated Artifact, and `createFunctionOrmExecutor` from
|
|
150
|
+
`@sequenceholdings/managed-functions/orm` inside a Managed Function. Both accept
|
|
151
|
+
the generated JSON manifest and preserve the caller's governed data access.
|
|
152
|
+
The host adapters supply authentication; they do not grant namespace access or
|
|
153
|
+
register operations. Do not extract CLI credentials or invent a browser token
|
|
154
|
+
provider to wire a generated client.
|