interaqt 1.3.0 → 1.5.0
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 +30 -0
- package/agent/skill/interaqt-migration.md +348 -0
- package/dist/core/Constraint.d.ts +54 -1
- package/dist/core/Constraint.d.ts.map +1 -1
- package/dist/core/EventSource.d.ts +3 -3
- package/dist/core/EventSource.d.ts.map +1 -1
- package/dist/core/StateMachine.d.ts.map +1 -1
- package/dist/drivers/Mysql.d.ts +4 -1
- package/dist/drivers/Mysql.d.ts.map +1 -1
- package/dist/drivers/PGLite.d.ts +4 -1
- package/dist/drivers/PGLite.d.ts.map +1 -1
- package/dist/drivers/PostgreSQL.d.ts +4 -1
- package/dist/drivers/PostgreSQL.d.ts.map +1 -1
- package/dist/drivers/SQLite.d.ts +4 -1
- package/dist/drivers/SQLite.d.ts.map +1 -1
- package/dist/index.js +5948 -4060
- package/dist/index.js.map +1 -1
- package/dist/runtime/Controller.d.ts +15 -1
- package/dist/runtime/Controller.d.ts.map +1 -1
- package/dist/runtime/MonoSystem.d.ts +18 -0
- package/dist/runtime/MonoSystem.d.ts.map +1 -1
- package/dist/runtime/System.d.ts +39 -1
- package/dist/runtime/System.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/migration.d.ts +376 -0
- package/dist/runtime/migration.d.ts.map +1 -0
- package/dist/runtime/transaction.d.ts +34 -0
- package/dist/runtime/transaction.d.ts.map +1 -1
- package/dist/storage/erstorage/SchemaDialect.d.ts +4 -2
- package/dist/storage/erstorage/SchemaDialect.d.ts.map +1 -1
- package/dist/storage/erstorage/Setup.d.ts +14 -2
- package/dist/storage/erstorage/Setup.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,36 @@ No update handlers. No sync bugs. When a like relationship is created, `likeCoun
|
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
64
|
+
## Dispatch Transactions
|
|
65
|
+
|
|
66
|
+
`Controller.dispatch()` is the synchronous fact transaction boundary in interaqt. The framework runs guard checks, `mapEventData`, event record creation, `resolve`, synchronous computations, and `afterDispatch` inside one retryable storage transaction attempt.
|
|
67
|
+
|
|
68
|
+
If any transaction step fails, the event record and all synchronous derived writes from that attempt are rolled back. `postCommit` and record mutation side effects run only after a successful commit; their failures are reported in `sideEffects` and do not roll back committed facts.
|
|
69
|
+
|
|
70
|
+
Use these hooks with the transaction boundary in mind:
|
|
71
|
+
|
|
72
|
+
| Hook | Transaction boundary |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `guard` / `mapEventData` / `resolve` | Run inside the retryable transaction attempt and may be replayed. |
|
|
75
|
+
| `afterDispatch` | Runs before commit inside the transaction. Use it only for response context or local reversible storage work. Do not perform irreversible external IO here. |
|
|
76
|
+
| `postCommit` | Runs after commit. Use it for external IO, notifications, outbox enqueueing, or non-critical response context. |
|
|
77
|
+
| `RecordMutationSideEffect` | Runs after commit for committed mutation events. Failure is reported in `sideEffects`. |
|
|
78
|
+
|
|
79
|
+
Nested `controller.dispatch()` calls are rejected inside a dispatch transaction with `NestedDispatchError`. Dispatching again from `postCommit` or a record mutation side effect is allowed because it starts a new transaction boundary.
|
|
80
|
+
|
|
81
|
+
Database drivers declare their transaction support through `getTransactionCapability()`:
|
|
82
|
+
|
|
83
|
+
| Driver | Transaction support |
|
|
84
|
+
|---|---|
|
|
85
|
+
| PostgreSQL | Strong transaction target: transaction-bound pool client, `READ COMMITTED` and `SERIALIZABLE`, PostgreSQL retryable SQLSTATE handling. |
|
|
86
|
+
| PGLite | Fallback support for local tests and framework retry-path metadata. `SERIALIZABLE` is not a production PostgreSQL isolation guarantee. |
|
|
87
|
+
| SQLite | Local fallback atomicity and framework retry-path metadata. It does not provide PostgreSQL-level concurrent dispatch isolation. |
|
|
88
|
+
| MySQL | Marked unsupported for strong dispatch transactions until it has a transaction-bound connection implementation. |
|
|
89
|
+
|
|
90
|
+
Useful exported helpers include `TransactionCapabilityError`, `TransactionRetryExhaustedError`, `NestedDispatchError`, `isTransactionCapabilityError()`, `isTransactionRetryExhaustedError()`, `isRetryableTransactionError()`, and `hasErrorCode()`.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
64
94
|
## Quick Example: Social Post System
|
|
65
95
|
|
|
66
96
|
```typescript
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# interaqt Migration Guide
|
|
2
|
+
|
|
3
|
+
> Use this guide when upgrading an existing interaqt database after changing entities, relations, properties, dictionaries, or computations.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What Migration Does
|
|
8
|
+
|
|
9
|
+
interaqt migration preserves existing fact data and recomputes derived data from the current reactive declarations.
|
|
10
|
+
|
|
11
|
+
Phase 1.5 uses a two-step review workflow:
|
|
12
|
+
|
|
13
|
+
1. Generate a structured diff with `controller.generateMigrationDiff()`.
|
|
14
|
+
2. Review the diff, set `status: "approved"`, add explicit decisions, then execute `controller.migrate({ approvedDiff })`.
|
|
15
|
+
|
|
16
|
+
Migration supports additive schema changes, changed/new computation recompute, downstream propagation, filtered membership rebuild, destructive-scope review, and post-backfill constraint verification.
|
|
17
|
+
|
|
18
|
+
Phase 1.5 does not guess or execute rename/copy/merge/split primitives. Rename candidates may be recorded for review, but compute-route migration will still obey physical layout and destructive-change safety gates.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Core APIs
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
await controller.setup(true)
|
|
26
|
+
await controller.setup(false)
|
|
27
|
+
|
|
28
|
+
const diff = await controller.generateMigrationDiff({
|
|
29
|
+
includeFunctionText: false,
|
|
30
|
+
includeDestructiveScope: true,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const approvedDiff = {
|
|
34
|
+
...diff,
|
|
35
|
+
status: 'approved' as const,
|
|
36
|
+
decisions: [
|
|
37
|
+
...diff.decisions,
|
|
38
|
+
// one explicit decision for every item in diff.requiredDecisions
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const dryRunPlan = await controller.migrate({ approvedDiff, dryRun: true })
|
|
43
|
+
const plan = await controller.migrate({ approvedDiff, handlers })
|
|
44
|
+
|
|
45
|
+
await controller.setup({ migrate: { approvedDiff, handlers } })
|
|
46
|
+
await controller.createMigrationBaseline()
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Important exports include:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import {
|
|
53
|
+
createMigrationManifest,
|
|
54
|
+
hashMigrationDiff,
|
|
55
|
+
readMigrationManifest,
|
|
56
|
+
writeMigrationManifest,
|
|
57
|
+
MigrationDiffFile,
|
|
58
|
+
MigrationDecision,
|
|
59
|
+
MigrationDecisionRequirement,
|
|
60
|
+
MigrationHandlers,
|
|
61
|
+
MigrationBaselineError,
|
|
62
|
+
PhysicalLayoutChangeError,
|
|
63
|
+
UnrebuildableComputationError,
|
|
64
|
+
AsyncMigrationComputationError,
|
|
65
|
+
DestructiveComputedOutputError,
|
|
66
|
+
} from 'interaqt'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`setup({ migrate: true })` and bare `controller.migrate()` are intentionally unsupported. Migration execution must carry an approved review artifact.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Recommended Lifecycle
|
|
74
|
+
|
|
75
|
+
### 1. First Install
|
|
76
|
+
|
|
77
|
+
Use `setup(true)` only for a fresh install or an intentional test reset. It creates tables, installs indexes/constraints, initializes computation state, and writes the baseline migration manifest.
|
|
78
|
+
|
|
79
|
+
### 2. Normal Startup
|
|
80
|
+
|
|
81
|
+
Use `setup(false)` when code and database manifest already match.
|
|
82
|
+
|
|
83
|
+
If the stored manifest differs from current definitions, `setup(false)` fails before installing the runtime map and tells you to generate and approve a migration diff.
|
|
84
|
+
|
|
85
|
+
### 3. Generate Review Diff
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const diff = await controller.generateMigrationDiff({
|
|
89
|
+
includeFunctionText: true,
|
|
90
|
+
includeDestructiveScope: true,
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
console.log(diff.changes)
|
|
94
|
+
console.log(diff.requiredDecisions)
|
|
95
|
+
console.log(diff.safety.blockingChanges)
|
|
96
|
+
console.log(diff.safety.destructiveScopes)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`changes` includes logical model changes (`record`, `property`, `relation`, `dictionary`), storage changes, and computation changes.
|
|
100
|
+
|
|
101
|
+
Function text/hash is review evidence only. interaqt does not automatically decide semantic change from `Function.toString()`.
|
|
102
|
+
|
|
103
|
+
### 4. Approve Decisions
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const approvedDiff = {
|
|
107
|
+
...diff,
|
|
108
|
+
status: 'approved' as const,
|
|
109
|
+
decisions: diff.requiredDecisions.map(item => {
|
|
110
|
+
if (item.kind === 'computation') {
|
|
111
|
+
return {
|
|
112
|
+
kind: 'computation' as const,
|
|
113
|
+
id: item.id,
|
|
114
|
+
dataContext: item.dataContext,
|
|
115
|
+
decision: item.recommendedDecision,
|
|
116
|
+
reason: 'reviewed and approved',
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (item.kind === 'event-rebuild-handler') {
|
|
121
|
+
return {
|
|
122
|
+
kind: 'event-rebuild-handler' as const,
|
|
123
|
+
dataContext: item.dataContext,
|
|
124
|
+
handlerRef: 'ticketStatus',
|
|
125
|
+
reason: 'status can be reconstructed from durable facts',
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (item.kind === 'async-completion-handler') {
|
|
130
|
+
return {
|
|
131
|
+
kind: 'async-completion-handler' as const,
|
|
132
|
+
dataContext: item.dataContext,
|
|
133
|
+
handlerRef: 'scoreCompletion',
|
|
134
|
+
reason: 'async args contain final value',
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
kind: 'destructive-scope' as const,
|
|
140
|
+
dataContext: item.dataContext,
|
|
141
|
+
recordName: item.recordName,
|
|
142
|
+
ids: item.ids,
|
|
143
|
+
reason: 'reviewed exact destructive scope',
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Approved decisions are audit data. Handler functions are not stored in the diff file.
|
|
150
|
+
|
|
151
|
+
### 5. Dry Run
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
const dryRunPlan = await controller.migrate({
|
|
155
|
+
approvedDiff,
|
|
156
|
+
dryRun: true,
|
|
157
|
+
handlers,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
console.log(dryRunPlan.blockingChanges)
|
|
161
|
+
console.log(dryRunPlan.rebuildPlan)
|
|
162
|
+
console.log(dryRunPlan.deletionScope)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Dry-run validates approved decisions, handler references, safety gates, and destructive scope ids. It does not apply schema, recompute data, or write the manifest.
|
|
166
|
+
|
|
167
|
+
### 6. Execute
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
const plan = await controller.migrate({
|
|
171
|
+
approvedDiff,
|
|
172
|
+
handlers,
|
|
173
|
+
})
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
On success, interaqt writes the new manifest and records approved diff metadata in the migration log.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Identity and Model Hash
|
|
181
|
+
|
|
182
|
+
Phase 1.5 does not require migration-specific `uuid`, `version`, or `migrationKey`.
|
|
183
|
+
|
|
184
|
+
Default identity comes from stable name paths:
|
|
185
|
+
|
|
186
|
+
- `entity:Product`
|
|
187
|
+
- `property:Product.price`
|
|
188
|
+
- `relation:ProductCategory`
|
|
189
|
+
- `dictionary:globalProductCount`
|
|
190
|
+
- `computation:property:Product.doublePrice:Custom`
|
|
191
|
+
|
|
192
|
+
If the same kind/name path appears more than once in one model, diff generation fails and asks you to make names explicit.
|
|
193
|
+
|
|
194
|
+
`uuid` is recorded as an auxiliary review clue when present, but it does not drive migration identity or model hash. This prevents random generated uuids from causing false manifest mismatches.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Computation Decisions
|
|
199
|
+
|
|
200
|
+
Use computation decisions to control recompute semantics:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
{ kind: 'computation', id, dataContext, decision: 'changed', reason: 'callback now doubles price' }
|
|
204
|
+
{ kind: 'computation', id, dataContext, decision: 'unchanged', reason: 'format-only callback change' }
|
|
205
|
+
{ kind: 'computation', id, dataContext, decision: 'state-only', reason: 'state default changed only' }
|
|
206
|
+
{ kind: 'computation', id, dataContext, decision: 'unrebuildable', reason: 'requires manual migration' }
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Rules:
|
|
210
|
+
|
|
211
|
+
- `changed` is a seed rebuild and propagates downstream output events.
|
|
212
|
+
- `unchanged` is not a seed rebuild, but it can still rebuild if an upstream changed output affects it.
|
|
213
|
+
- `state-only` rebuilds bound state without propagating output events.
|
|
214
|
+
- `unrebuildable` becomes a blocking change.
|
|
215
|
+
|
|
216
|
+
New computations must be approved as `changed`.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Event and Async Handlers
|
|
221
|
+
|
|
222
|
+
Event-based computations without full compute support require external rebuild handlers.
|
|
223
|
+
|
|
224
|
+
Async computations that return `ComputationResult.async()` require external completion handlers.
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
const handlers = {
|
|
228
|
+
eventRebuild: {
|
|
229
|
+
ticketStatus: async ({ record }) => record?.closedAt ? 'closed' : 'open',
|
|
230
|
+
},
|
|
231
|
+
asyncCompletion: {
|
|
232
|
+
scoreCompletion: async ({ args }) => (args as { finalValue: number }).finalValue,
|
|
233
|
+
},
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
await controller.migrate({ approvedDiff, handlers })
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Handler decisions reference handlers by `handlerRef`. Missing handlers fail fast. Handlers must return a direct final output; returning `ComputationResult.resolved()` or another async marker is rejected.
|
|
240
|
+
|
|
241
|
+
Do not put migration-only handlers on business model objects. `migrationCompute` and `migrationAsync` are not part of the Phase 1.5 workflow.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Destructive Computed Outputs
|
|
246
|
+
|
|
247
|
+
Migration refuses destructive computed output unless the approved diff contains an exact matching `destructive-scope` decision.
|
|
248
|
+
|
|
249
|
+
This covers:
|
|
250
|
+
|
|
251
|
+
- `_isDeleted_` computed property that deletes host records.
|
|
252
|
+
- Transform stale derived row cleanup.
|
|
253
|
+
- Entity/relation delete patches.
|
|
254
|
+
|
|
255
|
+
`generateMigrationDiff({ includeDestructiveScope: true })` reports candidate scopes. `migrate({ dryRun: true })` recalculates actual scope and fails if approved ids differ. Execution recalculates again before recompute.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Safety Gates
|
|
260
|
+
|
|
261
|
+
Approved diff cannot bypass core safety gates:
|
|
262
|
+
|
|
263
|
+
- Fact physical path moves remain blocked.
|
|
264
|
+
- Fact destructive schema changes remain blocked.
|
|
265
|
+
- Entity/relation output replacement still needs previous manifest ownership proof.
|
|
266
|
+
- Async computations require an approved async completion decision and runtime handler.
|
|
267
|
+
- Event-based computations without full compute require an approved event rebuild decision and runtime handler.
|
|
268
|
+
- Destructive computed output requires exact approved ids.
|
|
269
|
+
- Unique/non-null constraints are verified after backfill and before post-recompute indexes/constraints are created.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Baseline Existing Databases
|
|
274
|
+
|
|
275
|
+
If an existing database has no migration manifest, normal setup and migration fail.
|
|
276
|
+
|
|
277
|
+
Use `createMigrationBaseline()` only when current definitions exactly match the existing schema:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
await controller.createMigrationBaseline()
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Baseline creation fails if schema planning reports missing DDL or blocking changes. Do not use baseline to skip a real model change.
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Resume Behavior
|
|
288
|
+
|
|
289
|
+
Migration writes:
|
|
290
|
+
|
|
291
|
+
- `__interaqt_migration_manifest`
|
|
292
|
+
- `__interaqt_migration_log`
|
|
293
|
+
- `__interaqt_migration_lock`
|
|
294
|
+
- `__interaqt_migration_operation_log`
|
|
295
|
+
|
|
296
|
+
Resume is keyed by both `modelHash` and `approvedDiffHash`, so the same model with different review decisions does not reuse the wrong failed run.
|
|
297
|
+
|
|
298
|
+
Schema DDL, verification, post-recompute constraints, and manifest write use operation-log markers. Computation rebuild resume is phase-level, not per-computation checkpoint.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Common Failure Messages
|
|
303
|
+
|
|
304
|
+
### `Model manifest mismatch`
|
|
305
|
+
|
|
306
|
+
You called `setup(false)` with changed model definitions. Run `controller.generateMigrationDiff()`, approve it, then call `controller.migrate({ approvedDiff })`.
|
|
307
|
+
|
|
308
|
+
### `Migration requires an approved diff`
|
|
309
|
+
|
|
310
|
+
You called migration without reviewed input. Generate and approve a diff first.
|
|
311
|
+
|
|
312
|
+
### `Migration approvedDiff is stale`
|
|
313
|
+
|
|
314
|
+
The diff was generated for a different database manifest or current model. Generate a fresh diff and review it again.
|
|
315
|
+
|
|
316
|
+
### `Missing migration decision`
|
|
317
|
+
|
|
318
|
+
Every current required decision must have exactly one matching decision in the approved diff. Execution rebuilds the expected diff and does not trust a user-edited `requiredDecisions` list as the source of truth.
|
|
319
|
+
|
|
320
|
+
### `Missing migration event rebuild handler`
|
|
321
|
+
|
|
322
|
+
The approved diff references an event rebuild handler, but `migrate({ handlers })` did not provide it.
|
|
323
|
+
|
|
324
|
+
### `Missing migration async completion handler`
|
|
325
|
+
|
|
326
|
+
The approved diff references an async completion handler, but `migrate({ handlers })` did not provide it.
|
|
327
|
+
|
|
328
|
+
### `physical-path-move`
|
|
329
|
+
|
|
330
|
+
A fact record/property/relation moved physical storage location. Phase 1.5 will not guess a copy/rename.
|
|
331
|
+
|
|
332
|
+
### `destructive-computed-output`
|
|
333
|
+
|
|
334
|
+
Migration would delete computed output or host records. Inspect `diff.safety.destructiveScopes` and dry-run `deletionScope`, then approve exact ids only when intended.
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Safe Migration Checklist
|
|
339
|
+
|
|
340
|
+
- [ ] Run `controller.generateMigrationDiff({ includeDestructiveScope: true })`.
|
|
341
|
+
- [ ] Review logical model changes, storage changes, function hashes/text, required decisions, and safety output.
|
|
342
|
+
- [ ] Add one explicit decision for every required decision.
|
|
343
|
+
- [ ] Provide runtime handlers for event rebuild and async completion decisions.
|
|
344
|
+
- [ ] Run `controller.migrate({ approvedDiff, dryRun: true, handlers })`.
|
|
345
|
+
- [ ] Confirm `blockingChanges` is empty and `rebuildPlan` is expected.
|
|
346
|
+
- [ ] Confirm destructive scopes match exactly when cleanup is intentional.
|
|
347
|
+
- [ ] Run `controller.migrate({ approvedDiff, handlers })`.
|
|
348
|
+
- [ ] Run integration tests for the production driver, especially PostgreSQL/MySQL.
|
|
@@ -26,13 +26,23 @@ export interface UniqueConstraintInstance extends IInstance {
|
|
|
26
26
|
where?: ConstraintPredicate;
|
|
27
27
|
violationCode?: string;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export interface NonNullConstraintInstance extends IInstance {
|
|
30
|
+
name: string;
|
|
31
|
+
property: string;
|
|
32
|
+
violationCode?: string;
|
|
33
|
+
}
|
|
34
|
+
export type ConstraintInstance = UniqueConstraintInstance | NonNullConstraintInstance;
|
|
30
35
|
export interface UniqueConstraintCreateArgs {
|
|
31
36
|
name: string;
|
|
32
37
|
properties: string[];
|
|
33
38
|
where?: ConstraintPredicate;
|
|
34
39
|
violationCode?: string;
|
|
35
40
|
}
|
|
41
|
+
export interface NonNullConstraintCreateArgs {
|
|
42
|
+
name: string;
|
|
43
|
+
property: string;
|
|
44
|
+
violationCode?: string;
|
|
45
|
+
}
|
|
36
46
|
export declare class UniqueConstraint implements UniqueConstraintInstance {
|
|
37
47
|
uuid: string;
|
|
38
48
|
_type: string;
|
|
@@ -92,4 +102,47 @@ export declare class UniqueConstraint implements UniqueConstraintInstance {
|
|
|
92
102
|
static check(data: unknown): boolean;
|
|
93
103
|
static parse(json: string): UniqueConstraintInstance;
|
|
94
104
|
}
|
|
105
|
+
export declare class NonNullConstraint implements NonNullConstraintInstance {
|
|
106
|
+
uuid: string;
|
|
107
|
+
_type: string;
|
|
108
|
+
_options?: {
|
|
109
|
+
uuid?: string;
|
|
110
|
+
};
|
|
111
|
+
name: string;
|
|
112
|
+
property: string;
|
|
113
|
+
violationCode?: string;
|
|
114
|
+
constructor(args: NonNullConstraintCreateArgs, options?: {
|
|
115
|
+
uuid?: string;
|
|
116
|
+
});
|
|
117
|
+
static isKlass: true;
|
|
118
|
+
static displayName: string;
|
|
119
|
+
static instances: NonNullConstraintInstance[];
|
|
120
|
+
static public: {
|
|
121
|
+
name: {
|
|
122
|
+
type: "string";
|
|
123
|
+
required: true;
|
|
124
|
+
constraints: {
|
|
125
|
+
nameFormat: ({ name }: {
|
|
126
|
+
name: string;
|
|
127
|
+
}) => boolean;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
property: {
|
|
131
|
+
type: "string";
|
|
132
|
+
required: true;
|
|
133
|
+
};
|
|
134
|
+
violationCode: {
|
|
135
|
+
type: "string";
|
|
136
|
+
required: false;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
static create(args: NonNullConstraintCreateArgs, options?: {
|
|
140
|
+
uuid?: string;
|
|
141
|
+
}): NonNullConstraintInstance;
|
|
142
|
+
static stringify(instance: NonNullConstraintInstance): string;
|
|
143
|
+
static clone(instance: NonNullConstraintInstance): NonNullConstraintInstance;
|
|
144
|
+
static is(obj: unknown): obj is NonNullConstraintInstance;
|
|
145
|
+
static check(data: unknown): boolean;
|
|
146
|
+
static parse(json: string): NonNullConstraintInstance;
|
|
147
|
+
}
|
|
95
148
|
//# sourceMappingURL=Constraint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constraint.d.ts","sourceRoot":"","sources":["../../src/core/Constraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,iBAAiB,CAAC;AAI1E,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAExE,MAAM,MAAM,2BAA2B,GACnC;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,GAChB;IAAE,EAAE,EAAE,WAAW,CAAA;CAAE,GACnB;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,wBAAwB,CAAA;CAAE,GACjD;IAAE,EAAE,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,wBAAwB,CAAA;CAAE,GACpD;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,wBAAwB,EAAE,CAAA;CAAE,GAC/C;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,wBAAwB,EAAE,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,YAAY,EAAE,MAAM,GAAG,2BAA2B,CAAC;CACrD,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Constraint.d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s = unknown, TResult = void> extends II
|
|
|
13
13
|
/**
|
|
14
14
|
* Runs inside the dispatch transaction attempt and may be replayed on retry.
|
|
15
15
|
*/
|
|
16
|
-
mapEventData?: (args: TArgs) => Record<string, unknown
|
|
16
|
+
mapEventData?: (args: TArgs) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
17
17
|
/**
|
|
18
18
|
* Runs inside the dispatch transaction attempt and may be replayed on retry.
|
|
19
19
|
* External side effects should be modeled with record mutation side effects,
|
|
@@ -40,7 +40,7 @@ export interface EventSourceCreateArgs<TArgs = unknown, TResult = void> {
|
|
|
40
40
|
name: string;
|
|
41
41
|
entity: EntityInstance;
|
|
42
42
|
guard?: (this: CallbackThis, args: TArgs) => Promise<void>;
|
|
43
|
-
mapEventData?: (args: TArgs) => Record<string, unknown
|
|
43
|
+
mapEventData?: (args: TArgs) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
44
44
|
resolve?: (this: CallbackThis, args: TArgs) => Promise<TResult>;
|
|
45
45
|
afterDispatch?: (this: CallbackThis, args: TArgs, result: {
|
|
46
46
|
data?: TResult;
|
|
@@ -59,7 +59,7 @@ export declare class EventSource<TArgs = unknown, TResult = void> implements Eve
|
|
|
59
59
|
name: string;
|
|
60
60
|
entity: EntityInstance;
|
|
61
61
|
guard?: (this: CallbackThis, args: TArgs) => Promise<void>;
|
|
62
|
-
mapEventData?: (args: TArgs) => Record<string, unknown
|
|
62
|
+
mapEventData?: (args: TArgs) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
63
63
|
resolve?: (this: CallbackThis, args: TArgs) => Promise<TResult>;
|
|
64
64
|
afterDispatch?: (this: CallbackThis, args: TArgs, result: {
|
|
65
65
|
data?: TResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventSource.d.ts","sourceRoot":"","sources":["../../src/core/EventSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,iBAAiB,CAAC;AAC1E,OAAO,E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BAAoB,GAAG,MAAM;IAexD,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,GAAG,oBAAoB;IAQ/E,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,oBAAoB;IAIpD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAItC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB;CAIjD"}
|
package/dist/drivers/Mysql.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Database, DatabaseLogger, EntityIdRef } from '..';
|
|
1
|
+
import { Database, DatabaseLogger, EntityIdRef, TransactionCapability } from '..';
|
|
2
2
|
import { default as mysql, Connection, ConnectionOptions } from 'mysql2/promise';
|
|
3
3
|
import { defaultEncodeLiteral } from '../storage';
|
|
4
4
|
declare class IDSystem {
|
|
@@ -16,6 +16,7 @@ export declare class MysqlDB implements Database {
|
|
|
16
16
|
idSystem: IDSystem;
|
|
17
17
|
logger: DatabaseLogger;
|
|
18
18
|
db: Connection;
|
|
19
|
+
transactionCapability: TransactionCapability;
|
|
19
20
|
schemaDialect: {
|
|
20
21
|
name: "mysql";
|
|
21
22
|
maxIdentifierLength: number;
|
|
@@ -24,10 +25,12 @@ export declare class MysqlDB implements Database {
|
|
|
24
25
|
constraints: {
|
|
25
26
|
unique: boolean;
|
|
26
27
|
filteredUnique: boolean;
|
|
28
|
+
nonNull: boolean;
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
constructor(database: string, options?: MysqlDBConfig);
|
|
30
32
|
open(forceDrop?: boolean): Promise<void>;
|
|
33
|
+
openForSchemaRead(): Promise<void>;
|
|
31
34
|
query<T>(sql: string, where?: unknown[], name?: string): Promise<T[]>;
|
|
32
35
|
update<T>(sql: string, values: unknown[], idField?: string, name?: string): Promise<T[]>;
|
|
33
36
|
insert(sql: string, values: unknown[], name?: string): Promise<EntityIdRef>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mysql.d.ts","sourceRoot":"","sources":["../../src/drivers/Mysql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Mysql.d.ts","sourceRoot":"","sources":["../../src/drivers/Mysql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAgE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AACpJ,OAAO,KAAK,EAAE,EAAC,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAgB,MAAM,gBAAgB,CAAA;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,cAAM,QAAQ;IACS,EAAE,EAAE,QAAQ;gBAAZ,EAAE,EAAE,QAAQ;IAC/B,KAAK;IAGC,SAAS,CAAC,UAAU,EAAE,MAAM;CAWrC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,cAAc,CAAA;CAAE,CAAA;AAE7F,qBAAa,OAAQ,YAAW,QAAQ;IAqBjB,QAAQ,EAAC,MAAM;IAAS,OAAO,EAAE,aAAa;IApBjE,QAAQ,EAAG,QAAQ,CAAA;IACnB,MAAM,EAAE,cAAc,CAAA;IACtB,EAAE,EAAG,UAAU,CAAA;IACf,qBAAqB,EAAE,qBAAqB,CAS3C;IACD,aAAa;;;;;;;;;;MAMZ;gBACkB,QAAQ,EAAC,MAAM,EAAS,OAAO,GAAE,aAAkB;IAIhE,IAAI,CAAC,SAAS,UAAQ;IA0BtB,iBAAiB;IAWjB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAC,MAAM,EAAE,KAAK,GAAE,OAAO,EAAM,EAAE,IAAI,SAAI;IAanD,MAAM,CAAC,CAAC,EAAE,GAAG,EAAC,MAAM,EAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAC,MAAM,EAAE,IAAI,SAAG;IAehE,MAAM,CAAC,GAAG,EAAC,MAAM,EAAE,MAAM,EAAC,OAAO,EAAE,EAAE,IAAI,SAAG;IAmB5C,MAAM,CAAC,CAAC,EAAG,GAAG,EAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,SAAG;IAYhD,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAG;IAUjC,KAAK;IAGC,SAAS,CAAC,UAAU,EAAE,MAAM;IAGlC,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC,EAAE,MAAM,MAAM;;;;IAYzL,cAAc;IAKd,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO;CAmBtD"}
|
package/dist/drivers/PGLite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Database, DatabaseLogger, EntityIdRef } from '..';
|
|
1
|
+
import { Database, DatabaseLogger, EntityIdRef, TransactionCapability } from '..';
|
|
2
2
|
import { PGlite, Results } from '@electric-sql/pglite';
|
|
3
3
|
import { defaultEncodeLiteral } from '../storage';
|
|
4
4
|
declare class IDSystem {
|
|
@@ -17,6 +17,7 @@ export declare class PGLiteDB implements Database {
|
|
|
17
17
|
logger: DatabaseLogger;
|
|
18
18
|
db: InstanceType<typeof PGlite>;
|
|
19
19
|
supportsSelectForUpdate: boolean;
|
|
20
|
+
transactionCapability: TransactionCapability;
|
|
20
21
|
schemaDialect: {
|
|
21
22
|
name: "postgres";
|
|
22
23
|
maxIdentifierLength: number;
|
|
@@ -25,10 +26,12 @@ export declare class PGLiteDB implements Database {
|
|
|
25
26
|
constraints: {
|
|
26
27
|
unique: boolean;
|
|
27
28
|
filteredUnique: boolean;
|
|
29
|
+
nonNull: boolean;
|
|
28
30
|
};
|
|
29
31
|
};
|
|
30
32
|
constructor(database?: string | undefined, options?: PGLiteDBConfig);
|
|
31
33
|
open(forceDrop?: boolean): Promise<void>;
|
|
34
|
+
openForSchemaRead(): Promise<void>;
|
|
32
35
|
setupInternalComputationState(): Promise<void>;
|
|
33
36
|
query<T>(sql: string, params?: unknown[], name?: string): Promise<T[]>;
|
|
34
37
|
update<T>(sql: string, values: unknown[], idField?: string, name?: string): Promise<T[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PGLite.d.ts","sourceRoot":"","sources":["../../src/drivers/PGLite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"PGLite.d.ts","sourceRoot":"","sources":["../../src/drivers/PGLite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAA6E,qBAAqB,EAAC,MAAM,UAAU,CAAC;AACjK,OAAO,EAAE,MAAM,EAAC,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,cAAM,QAAQ;IACS,EAAE,EAAE,QAAQ;gBAAZ,EAAE,EAAE,QAAQ;IAC/B,KAAK;IAGC,SAAS,CAAC,UAAU,EAAE,MAAM;CAGrC;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,CAAC,EAAE,cAAc,CAAA;CAAE,CAAA;AAExD,qBAAa,QAAS,YAAW,QAAQ;IAsBlB,QAAQ,CAAC,EAAC,MAAM;IAAS,OAAO,EAAE,cAAc;IArBnE,QAAQ,EAAG,QAAQ,CAAA;IACnB,MAAM,EAAE,cAAc,CAAA;IACtB,EAAE,EAAE,YAAY,CA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apability, TransactionOptions } from '..';
|
|
2
2
|
import { default as pg, ClientConfig } from 'pg';
|
|
3
3
|
import { defaultEncodeLiteral } from '../storage';
|
|
4
4
|
declare const Client: typeof pg.Client, Pool: typeof pg.Pool;
|
|
@@ -31,6 +31,7 @@ export declare class PostgreSQLDB implements Database {
|
|
|
31
31
|
pool?: InstanceType<typeof Pool>;
|
|
32
32
|
private transactionContext;
|
|
33
33
|
supportsSelectForUpdate: boolean;
|
|
34
|
+
transactionCapability: TransactionCapability;
|
|
34
35
|
schemaDialect: {
|
|
35
36
|
name: "postgres";
|
|
36
37
|
maxIdentifierLength: number;
|
|
@@ -39,10 +40,12 @@ export declare class PostgreSQLDB implements Database {
|
|
|
39
40
|
constraints: {
|
|
40
41
|
unique: boolean;
|
|
41
42
|
filteredUnique: boolean;
|
|
43
|
+
nonNull: boolean;
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
constructor(database: string, options?: PostgreSQLDBConfig);
|
|
45
47
|
open(forceDrop?: boolean): Promise<void>;
|
|
48
|
+
openForSchemaRead(): Promise<void>;
|
|
46
49
|
private getQueryable;
|
|
47
50
|
runInTransaction<T>(options: TransactionOptions, fn: () => Promise<T>): Promise<T>;
|
|
48
51
|
setupInternalComputationState(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgreSQL.d.ts","sourceRoot":"","sources":["../../src/drivers/PostgreSQL.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAuG,kBAAkB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"PostgreSQL.d.ts","sourceRoot":"","sources":["../../src/drivers/PostgreSQL.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAuG,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAG/M,OAAO,EAAE,EAAE,EAAE,KAAK,YAAY,EAAk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