@aventara/prisma7-adapter 0.1.0-pilot.4 → 1.0.0-rc.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/CHANGELOG.md +597 -0
- package/README.md +363 -317
- package/dist/discovery/artifact.loader.d.ts +4 -4
- package/dist/discovery/artifact.loader.js +17 -19
- package/dist/discovery/capability-surface.interface.d.ts +8 -1
- package/dist/discovery/capability.deriver.d.ts +6 -6
- package/dist/discovery/capability.deriver.js +6 -3
- package/dist/discovery/client-shape.verifier.d.ts +1 -1
- package/dist/discovery/client-shape.verifier.js +2 -2
- package/dist/discovery/discovery-artifact.interface.d.ts +38 -43
- package/dist/discovery/discovery-artifact.interface.js +1 -1
- package/dist/discovery/enum.mapper.d.ts +2 -2
- package/dist/discovery/field.mapper.d.ts +13 -13
- package/dist/discovery/field.mapper.js +11 -11
- package/dist/discovery/identifier.mapper.d.ts +7 -7
- package/dist/discovery/model.discoverer.d.ts +4 -4
- package/dist/discovery/model.discoverer.js +51 -20
- package/dist/discovery/operations.deriver.d.ts +6 -5
- package/dist/discovery/schema-facts.interface.d.ts +3 -3
- package/dist/discovery/schema.reader.d.ts +2 -2
- package/dist/discovery/schema.reader.js +5 -5
- package/dist/discovery/types.reader.d.ts +2 -2
- package/dist/discovery/types.reader.js +33 -22
- package/dist/discovery/vocabulary.dictionary.d.ts +14 -13
- package/dist/discovery/vocabulary.dictionary.js +1 -1
- package/dist/errors/error.normalizer.d.ts +11 -5
- package/dist/errors/error.normalizer.js +27 -5
- package/dist/errors/prisma-error.reader.d.ts +2 -0
- package/dist/errors/prisma-error.reader.js +1 -0
- package/dist/execution/first-variant.emulator.d.ts +4 -4
- package/dist/execution/first-variant.emulator.js +13 -9
- package/dist/execution/operation.executor.d.ts +9 -8
- package/dist/execution/operation.executor.js +17 -13
- package/dist/execution/result.shaper.d.ts +3 -3
- package/dist/execution/result.shaper.js +7 -7
- package/dist/execution/sql-statement.executor.d.ts +9 -0
- package/dist/execution/sql-statement.executor.js +58 -0
- package/dist/execution/transaction.executor.d.ts +8 -7
- package/dist/execution/transaction.executor.js +9 -5
- package/dist/generate/artifact.emitter.d.ts +5 -7
- package/dist/generate/artifact.emitter.js +11 -22
- package/dist/generate/discovery.cli.d.ts +3 -3
- package/dist/generate/discovery.cli.js +11 -11
- package/dist/generate/existence.gate.d.ts +4 -4
- package/dist/generate/existence.gate.js +4 -4
- package/dist/generate/index.d.ts +5 -5
- package/dist/generate/index.js +2 -2
- package/dist/generate/prisma.generate.d.ts +7 -8
- package/dist/generate/prisma.generate.js +11 -12
- package/dist/index.d.ts +4 -4
- package/dist/prisma-client.interface.d.ts +22 -8
- package/dist/prisma-client.interface.js +7 -0
- package/dist/prisma.adapter.d.ts +12 -12
- package/dist/prisma.adapter.js +12 -3
- package/dist/provider/provider-profile.d.ts +11 -11
- package/dist/translation/mutation.translator.d.ts +8 -8
- package/dist/translation/mutation.translator.js +31 -31
- package/dist/translation/operation.translator.d.ts +7 -6
- package/dist/translation/operation.translator.js +12 -12
- package/dist/translation/order-pagination.translator.d.ts +5 -5
- package/dist/translation/order-pagination.translator.js +16 -16
- package/dist/translation/projection.translator.d.ts +4 -4
- package/dist/translation/projection.translator.js +11 -11
- package/dist/translation/scalar.conversion.d.ts +9 -8
- package/dist/translation/scalar.conversion.js +11 -11
- package/dist/translation/where.translator.d.ts +5 -5
- package/dist/translation/where.translator.js +15 -15
- package/package.json +5 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
# @aventara/prisma7-adapter
|
|
2
|
+
|
|
3
|
+
## 1.0.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 800123b: New: `framework.appTx.$sql`, a developer SQL step in an application transaction. Write it as a tagged template,
|
|
8
|
+
`` framework.appTx.$sql<Row>`select pgmq.send('jobs', jsonb_build_object('postId', ${post.$ref("id")}))` ``, and put it in
|
|
9
|
+
`framework.transaction([...])` beside the other steps. Every interpolated value is a bound parameter, never SQL text:
|
|
10
|
+
strings, numbers, booleans, `bigint`, `null`, `Date`, `Decimal`, bytes, JSON values (bound as JSON text, so cast them
|
|
11
|
+
with `::jsonb`), and a `$ref` to an earlier step's field, read after that step ran. The statement runs in order in the
|
|
12
|
+
same database transaction, so a failure anywhere rolls everything back, and its rows are that step's entry in the
|
|
13
|
+
result, typed `Row[]` (or `unknown[]`). A plain-string call is refused, a later step cannot `$ref` a SQL step's rows,
|
|
14
|
+
and no pipeline runs around it.
|
|
15
|
+
|
|
16
|
+
It is server-side only: `clientTx` has no `$sql`, the ClientContract and its hash are unchanged, and `/_transactions`
|
|
17
|
+
cannot carry one.
|
|
18
|
+
|
|
19
|
+
The Prisma 7 adapter runs it with `$queryRaw` in its tagged form on the transaction client. A raw query's failure is
|
|
20
|
+
`P2010` on Prisma 7.10.0: a uniqueness or foreign-key violation answers `A2008`, anything else `A3001`. The rule is now
|
|
21
|
+
that Aventara never writes raw SQL itself, and developer SQL only goes through this bound template.
|
|
22
|
+
|
|
23
|
+
Adapter authors: an adapter declares `sqlStatements: true`, has an `executeSql` of its own (a plain statement, outside
|
|
24
|
+
any transaction: a stage's `ctx.$sql` there) and gives its transaction executor one too (`AvAdapter.executeSql`,
|
|
25
|
+
`AvAdapterTransactionExecutor`, `AvAdapterSqlStatement` in `@aventara/core/internal`). Without the declaration, a plan
|
|
26
|
+
with a SQL step is refused with `A2002`. The Prisma 7 adapter runs a statement outside a transaction with `$queryRaw`
|
|
27
|
+
on the base client, and declares `sqlStatements` with every driver.
|
|
28
|
+
|
|
29
|
+
- 8bb1d6a: Breaking: public type and class names take the `Av` prefix. Every public type and class is now `Av` plus what
|
|
30
|
+
it is, with a namespace only where the bare name would be ambiguous: configuration types are `AvConfig…`
|
|
31
|
+
(`AvConfig`, `AvConfigLayer`, `AvConfigResource`, …) and the three Contracts are `AvContract…` (`AvContractCore`,
|
|
32
|
+
`AvContractApplication`, `AvContractClient`). Functions keep their names (`createFramework`, `createFakeAdapter`,
|
|
33
|
+
`createPrismaAdapter`, `defineClientConfig`, `env`), and so do the names that already started with `Av`,
|
|
34
|
+
`AventaraModule`, `AventaraModuleOptions` and `AventaraModuleAsyncOptions`. There are no
|
|
35
|
+
aliases: replace each old name with the new one.
|
|
36
|
+
|
|
37
|
+
Three names merged or left:
|
|
38
|
+
|
|
39
|
+
- `PipelineContext` and `ComputeContext` (which was the same type) are one name, `AvContext`. A compute stage
|
|
40
|
+
now gets its own read-only ctx, `AvComputeContext` (see the ctx entry in `@aventara/core`'s changelog).
|
|
41
|
+
- `ComputedRead` is `AvComputeRead`, the one name of a read compute stage: a function, or `{ compute, dependsOn }`.
|
|
42
|
+
`ComputeOnRead`, the bare function type, is no longer exported; `AvComputeRead` accepts the function as it is.
|
|
43
|
+
- `defineFields` and `FrameworkFieldsShape` are removed; `defineResource` replaces them (below).
|
|
44
|
+
|
|
45
|
+
`defineResource` replaces `defineFields`. A Resource's configuration, its root block and its overlay blocks, can
|
|
46
|
+
live in its own module and be spread into each layer's `resources` tree:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
export const submission = defineResource<Model>()(
|
|
50
|
+
"Submission",
|
|
51
|
+
{
|
|
52
|
+
pipelines: { guards: [signedIn] },
|
|
53
|
+
fields: { title: { pipelines: { pipes: [trim] } } },
|
|
54
|
+
},
|
|
55
|
+
{ client: { fields: { title: { pipelines: { validators: [AvZ.maxLength(80)] } } } } },
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// aventara.config.ts
|
|
59
|
+
resources: { ...submission.root, ...payment.root },
|
|
60
|
+
client: { resources: { ...submission.client } },
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
It returns `{ root, application?, client? }`, each `{ Submission: block }`; a layer given no block is left out. The
|
|
64
|
+
root block is typed exactly as `resources.Submission` is typed in place: field definitions are checked against what
|
|
65
|
+
the adapter discovered, stages are typed for the Resource, and a key no level admits is a type error at the key.
|
|
66
|
+
Each overlay block is typed as `application.resources.Submission` or `client.resources.Submission` is in place,
|
|
67
|
+
against the root block: it may name a field the root block defines, and a `definition` in it is a type error (and
|
|
68
|
+
`CONFIG_FORBIDDEN_IN_OVERLAY` at startup). Spread, the configuration is the inline one: the same Contracts and
|
|
69
|
+
ClientContract hash. A field `definition` that `defineFields` returned now sits at
|
|
70
|
+
`fields.<field>.definition` inside the block.
|
|
71
|
+
|
|
72
|
+
The generated client's names follow the same rule. Regenerate with `avclient generate`; then rename the
|
|
73
|
+
imports from `AvClient.ts`:
|
|
74
|
+
|
|
75
|
+
| Before | After |
|
|
76
|
+
| ----------------------- | ------------------------- |
|
|
77
|
+
| `AuthError` | `AvAuthError` |
|
|
78
|
+
| `CallOptions` | `AvCallOptions` |
|
|
79
|
+
| `Cause` | `AvCause` |
|
|
80
|
+
| `ConflictError` | `AvConflictError` |
|
|
81
|
+
| `ContractMismatchError` | `AvContractMismatchError` |
|
|
82
|
+
| `Decimal` | `AvDecimal` |
|
|
83
|
+
| `Fetch` | `AvFetch` |
|
|
84
|
+
| `FrameworkError` | `AvError` |
|
|
85
|
+
| `InternalError` | `AvInternalError` |
|
|
86
|
+
| `NotFoundError` | `AvNotFoundError` |
|
|
87
|
+
| `Operation<T>` | `AvOperation<T>` |
|
|
88
|
+
| `OperationCode` | `AvOperationCode` |
|
|
89
|
+
| `ProtocolError` | `AvProtocolError` |
|
|
90
|
+
| `TransportError` | `AvTransportError` |
|
|
91
|
+
| `ValidationCode` | `AvValidationCode` |
|
|
92
|
+
| `ValidationError` | `AvValidationError` |
|
|
93
|
+
| `ValidationIssue` | `AvValidationIssue` |
|
|
94
|
+
|
|
95
|
+
An enum whose name is one of these now walks the rename ladder (`AvDecimal` → `AvDecimalEnum`); an enum named
|
|
96
|
+
`Decimal` is emitted as `Decimal`.
|
|
97
|
+
|
|
98
|
+
`@aventara/core`, every renamed export:
|
|
99
|
+
|
|
100
|
+
| Before | After |
|
|
101
|
+
| ------------------------------------- | ---------------------------------- |
|
|
102
|
+
| `Adapter` | `AvAdapter` |
|
|
103
|
+
| `AdapterDiscoveryDiagnostic` | `AvAdapterDiscoveryDiagnostic` |
|
|
104
|
+
| `AdapterDiscoveryDiagnosticCode` | `AvAdapterDiscoveryDiagnosticCode` |
|
|
105
|
+
| `AdapterModel` | `AvAdapterModel` |
|
|
106
|
+
| `AddedFieldDefinition` | `AvConfigAddedFieldDefinition` |
|
|
107
|
+
| `AfterHook` | `AvAfterHook` |
|
|
108
|
+
| `AnyFrameworkConfig` | `AvConfigAny` |
|
|
109
|
+
| `AnyLayerConfig` | `AvConfigLayerAny` |
|
|
110
|
+
| `AnyResourcesBlock` | `AvConfigResourcesAny` |
|
|
111
|
+
| `ApplicationContract` | `AvContractApplication` |
|
|
112
|
+
| `ApplicationScalarForms` | `AvApplicationScalarForms` |
|
|
113
|
+
| `BeforeHook` | `AvBeforeHook` |
|
|
114
|
+
| `BuiltInScalar` | `AvBuiltInScalar` |
|
|
115
|
+
| `Cause` | `AvCause` |
|
|
116
|
+
| `ClientContract` | `AvContractClient` |
|
|
117
|
+
| `ClientContractProtocol` | `AvContractClientProtocol` |
|
|
118
|
+
| `ComputedRead` | `AvComputeRead` |
|
|
119
|
+
| `ComputeOnCreate` | `AvComputeCreate` |
|
|
120
|
+
| `ComputeOnUpdate` | `AvComputeUpdate` |
|
|
121
|
+
| `ConfigDiagnostic` | `AvConfigDiagnostic` |
|
|
122
|
+
| `ConfigDiagnosticCode` | `AvConfigDiagnosticCode` |
|
|
123
|
+
| `ConfigFieldKey` | `AvConfigFieldKey` |
|
|
124
|
+
| `ConfigLayer` | `AvConfigLayerName` |
|
|
125
|
+
| `Contract` | `AvContract` |
|
|
126
|
+
| `ContractCompilerDiagnostic` | `AvContractCompilerDiagnostic` |
|
|
127
|
+
| `ContractCompilerDiagnosticCode` | `AvContractCompilerDiagnosticCode` |
|
|
128
|
+
| `ContractHash` | `AvContractHash` |
|
|
129
|
+
| `ContractLimits` | `AvContractLimits` |
|
|
130
|
+
| `ContractProtocol` | `AvContractProtocol` |
|
|
131
|
+
| `CoreContract` | `AvContractCore` |
|
|
132
|
+
| `CreateDataInput` | `AvCreateDataInput` |
|
|
133
|
+
| `CursorInput` | `AvCursorInput` |
|
|
134
|
+
| `Decimal` | `AvDecimal` |
|
|
135
|
+
| `DeferredOperationCall` | `AvDeferredOperationCall` |
|
|
136
|
+
| `EffectiveFieldKey` | `AvEffectiveFieldKey` |
|
|
137
|
+
| `EnumDefinition` | `AvEnumDefinition` |
|
|
138
|
+
| `ExactFrameworkConfig` | `AvConfigExact` |
|
|
139
|
+
| `ExecutionOptions` | `AvExecutionOptions` |
|
|
140
|
+
| `Field` | `AvField` |
|
|
141
|
+
| `FieldComputeConfig` | `AvFieldCompute` |
|
|
142
|
+
| `FieldKey` | `AvFieldKey` |
|
|
143
|
+
| `FieldPipe` | `AvFieldPipe` |
|
|
144
|
+
| `FieldWriteGuard` | `AvFieldGuard` |
|
|
145
|
+
| `Filter` | `AvFilter` |
|
|
146
|
+
| `Framework` | `AvFramework` |
|
|
147
|
+
| `FrameworkConfig` | `AvConfig` |
|
|
148
|
+
| `FrameworkConstructionDiagnostic` | `AvConstructionDiagnostic` |
|
|
149
|
+
| `FrameworkConstructionError` | `AvConstructionError` |
|
|
150
|
+
| `FrameworkConstructionStage` | `AvConstructionStage` |
|
|
151
|
+
| `FrameworkContracts` | `AvContracts` |
|
|
152
|
+
| `FrameworkDiagnostic` | `AvDiagnostic` |
|
|
153
|
+
| `FrameworkDiagnosticsSink` | `AvDiagnosticsSink` |
|
|
154
|
+
| `FrameworkError` | `AvError` |
|
|
155
|
+
| `FrameworkExemptionsConfig` | `AvConfigExemptions` |
|
|
156
|
+
| `FrameworkFamilyConfig` | `AvConfigFamily` |
|
|
157
|
+
| `FrameworkFieldDefinition` | `AvConfigFieldDefinition` |
|
|
158
|
+
| `FrameworkFieldLifecycleTrait` | `AvConfigFieldLifecycleTrait` |
|
|
159
|
+
| `FrameworkLayerConfig` | `AvConfigLayer` |
|
|
160
|
+
| `FrameworkLayerKind` | `AvConfigLayerKind` |
|
|
161
|
+
| `FrameworkLimitsConfig` | `AvConfigLimits` |
|
|
162
|
+
| `FrameworkMisuseEvent` | `AvMisuseEvent` |
|
|
163
|
+
| `FrameworkMisuseSink` | `AvMisuseSink` |
|
|
164
|
+
| `FrameworkOperationsConfig` | `AvConfigOperations` |
|
|
165
|
+
| `FrameworkOperationsExemption` | `AvConfigOperationsExemption` |
|
|
166
|
+
| `FrameworkOverlayFieldConfig` | `AvConfigOverlayField` |
|
|
167
|
+
| `FrameworkRelationFieldExemption` | `AvConfigRelationFieldExemption` |
|
|
168
|
+
| `FrameworkResourceConfig` | `AvConfigResource` |
|
|
169
|
+
| `FrameworkResourceExemption` | `AvConfigResourceExemption` |
|
|
170
|
+
| `FrameworkResourceFieldsConfig` | `AvConfigResourceFields` |
|
|
171
|
+
| `FrameworkResourceKey` | `AvConfigResourceKey` |
|
|
172
|
+
| `FrameworkResourcesConfig` | `AvConfigResources` |
|
|
173
|
+
| `FrameworkResourceTransactionsConfig` | `AvConfigResourceTransactions` |
|
|
174
|
+
| `FrameworkRootFieldConfig` | `AvConfigRootField` |
|
|
175
|
+
| `FrameworkScalarFieldExemption` | `AvConfigScalarFieldExemption` |
|
|
176
|
+
| `FrameworkScalarTypeRef` | `AvConfigScalarTypeRef` |
|
|
177
|
+
| `FrameworkVariantConfig` | `AvConfigVariant` |
|
|
178
|
+
| `Guard` | `AvGuard` |
|
|
179
|
+
| `Identifier` | `AvIdentifier` |
|
|
180
|
+
| `IncludeInput` | `AvIncludeInput` |
|
|
181
|
+
| `Interceptor` | `AvInterceptor` |
|
|
182
|
+
| `JsonValue` | `AvJsonValue` |
|
|
183
|
+
| `KnownFieldDefinition` | `AvConfigKnownFieldDefinition` |
|
|
184
|
+
| `LifecycleTrait` | `AvLifecycleTrait` |
|
|
185
|
+
| `NullsOrder` | `AvNullsOrder` |
|
|
186
|
+
| `Operation` | `AvOperation` |
|
|
187
|
+
| `OperationArgumentMap` | `AvOperationArgumentMap` |
|
|
188
|
+
| `OperationArgumentsFor` | `AvOperationArgumentsFor` |
|
|
189
|
+
| `OperationAvailability` | `AvOperationAvailability` |
|
|
190
|
+
| `OperationCall` | `AvOperationCall` |
|
|
191
|
+
| `OperationCode` | `AvOperationCode` |
|
|
192
|
+
| `OperationDiagnostic` | `AvOperationDiagnostic` |
|
|
193
|
+
| `OperationErrorCode` | `AvOperationErrorCode` |
|
|
194
|
+
| `OperationFailureResponse` | `AvOperationFailureResponse` |
|
|
195
|
+
| `OperationFamily` | `AvOperationFamily` |
|
|
196
|
+
| `OperationGrammar` | `AvOperationGrammar` |
|
|
197
|
+
| `OperationIdentity` | `AvOperationIdentity` |
|
|
198
|
+
| `OperationNoMatchResponse` | `AvOperationNoMatchResponse` |
|
|
199
|
+
| `OperationReferenceSurface` | `AvOperationReferenceSurface` |
|
|
200
|
+
| `OperationResponse` | `AvOperationResponse` |
|
|
201
|
+
| `OperationResultFor` | `AvOperationResultFor` |
|
|
202
|
+
| `OperationSlot` | `AvOperationSlot` |
|
|
203
|
+
| `OperationSuccessCode` | `AvOperationSuccessCode` |
|
|
204
|
+
| `OperationSuccessDataCode` | `AvOperationSuccessDataCode` |
|
|
205
|
+
| `OperationSuccessResponse` | `AvOperationSuccessResponse` |
|
|
206
|
+
| `OperationVariant` | `AvOperationVariant` |
|
|
207
|
+
| `OperationVariantScopes` | `AvOperationVariantScopes` |
|
|
208
|
+
| `OrderByEntry` | `AvOrderByEntry` |
|
|
209
|
+
| `OrderByInput` | `AvOrderByInput` |
|
|
210
|
+
| `PaginationCapability` | `AvPaginationCapability` |
|
|
211
|
+
| `Pipe` | `AvPipe` |
|
|
212
|
+
| `PipelineConfig` | `AvPipeline` |
|
|
213
|
+
| `PipelineContext` | `AvContext` |
|
|
214
|
+
| `PipelineTransportContext` | `AvTransportContext` |
|
|
215
|
+
| `ProjectionEntry` | `AvProjectionEntry` |
|
|
216
|
+
| `ProjectionScope` | `AvProjectionScope` |
|
|
217
|
+
| `ProjectionScopes` | `AvProjectionScopes` |
|
|
218
|
+
| `ReferenceableField` | `AvReferenceableField` |
|
|
219
|
+
| `ReferenceBuilder` | `AvReferenceBuilder` |
|
|
220
|
+
| `RelationField` | `AvRelationField` |
|
|
221
|
+
| `RelationFieldCapabilities` | `AvRelationFieldCapabilities` |
|
|
222
|
+
| `RelationFieldCapabilityName` | `AvRelationFieldCapabilityName` |
|
|
223
|
+
| `RelationFieldPipelineConfig` | `AvRelationFieldPipeline` |
|
|
224
|
+
| `RelationFilterCapability` | `AvRelationFilterCapability` |
|
|
225
|
+
| `RelationMutationCapability` | `AvRelationMutationCapability` |
|
|
226
|
+
| `RelationMutationDirective` | `AvRelationMutationDirective` |
|
|
227
|
+
| `RelationProjectionCapability` | `AvRelationProjectionCapability` |
|
|
228
|
+
| `RelationProjectionInput` | `AvRelationProjectionInput` |
|
|
229
|
+
| `RelationReducer` | `AvRelationReducer` |
|
|
230
|
+
| `RelationReducerCapability` | `AvRelationReducerCapability` |
|
|
231
|
+
| `RequestOrigin` | `AvRequestOrigin` |
|
|
232
|
+
| `Resource` | `AvResource` |
|
|
233
|
+
| `ResourceFieldMap` | `AvResourceFieldMap` |
|
|
234
|
+
| `ResourceKey` | `AvResourceKey` |
|
|
235
|
+
| `ResourceOperations` | `AvResourceOperations` |
|
|
236
|
+
| `ScalarDefinition` | `AvScalarDefinition` |
|
|
237
|
+
| `ScalarField` | `AvScalarField` |
|
|
238
|
+
| `ScalarFieldCapabilities` | `AvScalarFieldCapabilities` |
|
|
239
|
+
| `ScalarFieldCapabilityName` | `AvScalarFieldCapabilityName` |
|
|
240
|
+
| `ScalarFieldKey` | `AvScalarFieldKey` |
|
|
241
|
+
| `ScalarFieldPipelineConfig` | `AvScalarFieldPipeline` |
|
|
242
|
+
| `ScalarFilterOperator` | `AvScalarFilterOperator` |
|
|
243
|
+
| `ScalarFormat` | `AvScalarFormat` |
|
|
244
|
+
| `ScalarMutationDirective` | `AvScalarMutationDirective` |
|
|
245
|
+
| `ScalarOrderInput` | `AvScalarOrderInput` |
|
|
246
|
+
| `ScalarRegistry` | `AvScalarRegistry` |
|
|
247
|
+
| `ScalarValueType` | `AvScalarValueType` |
|
|
248
|
+
| `ScopedRelationMutations` | `AvScopedRelationMutations` |
|
|
249
|
+
| `ScopedRelationReducers` | `AvScopedRelationReducers` |
|
|
250
|
+
| `SelectInput` | `AvSelectInput` |
|
|
251
|
+
| `SingleRowResult` | `AvSingleRowResult` |
|
|
252
|
+
| `SortDirection` | `AvSortDirection` |
|
|
253
|
+
| `TransactionAfterHook` | `AvTransactionAfterHook` |
|
|
254
|
+
| `TransactionBeforeHook` | `AvTransactionBeforeHook` |
|
|
255
|
+
| `TransactionCapability` | `AvTransactionCapability` |
|
|
256
|
+
| `TransactionCommittedResponse` | `AvTransactionCommittedResponse` |
|
|
257
|
+
| `TransactionDiagnostic` | `AvTransactionDiagnostic` |
|
|
258
|
+
| `TransactionFilter` | `AvTransactionFilter` |
|
|
259
|
+
| `TransactionGuard` | `AvTransactionGuard` |
|
|
260
|
+
| `TransactionIntegrityError` | `AvTransactionIntegrityError` |
|
|
261
|
+
| `TransactionIntegrityViolation` | `AvTransactionIntegrityViolation` |
|
|
262
|
+
| `TransactionInterceptor` | `AvTransactionInterceptor` |
|
|
263
|
+
| `TransactionPipe` | `AvTransactionPipe` |
|
|
264
|
+
| `TransactionPipelineConfig` | `AvTransactionPipeline` |
|
|
265
|
+
| `TransactionPipelineContext` | `AvTransactionContext` |
|
|
266
|
+
| `TransactionReference` | `AvTransactionReference` |
|
|
267
|
+
| `TransactionResponse` | `AvTransactionResponse` |
|
|
268
|
+
| `TransactionResults` | `AvTransactionResults` |
|
|
269
|
+
| `TransactionRunner` | `AvTransactionRunner` |
|
|
270
|
+
| `TransactionSlotPathError` | `AvTransactionSlotPathError` |
|
|
271
|
+
| `TransactionSlotPathViolation` | `AvTransactionSlotPathViolation` |
|
|
272
|
+
| `UniqueWhereInput` | `AvUniqueWhereInput` |
|
|
273
|
+
| `UpdateDataInput` | `AvUpdateDataInput` |
|
|
274
|
+
| `ValidationCode` | `AvValidationCode` |
|
|
275
|
+
| `ValidationIssue` | `AvValidationIssue` |
|
|
276
|
+
| `WhereInput` | `AvWhereInput` |
|
|
277
|
+
| `WireScalarForms` | `AvWireScalarForms` |
|
|
278
|
+
| `WriteScope` | `AvWriteScope` |
|
|
279
|
+
| `WriteScopes` | `AvWriteScopes` |
|
|
280
|
+
|
|
281
|
+
Error classes whose `name` a log or a test may read:
|
|
282
|
+
|
|
283
|
+
| Before | After |
|
|
284
|
+
| ------------------------ | -------------------------- |
|
|
285
|
+
| `CallerDataError` | `AvCallerDataError` |
|
|
286
|
+
| `ClientConfigError` | `AvClientConfigError` |
|
|
287
|
+
| `ComputedValueError` | `AvComputedValueError` |
|
|
288
|
+
| `ContractProtocolError` | `AvContractProtocolError` |
|
|
289
|
+
| `ContractTransportError` | `AvContractTransportError` |
|
|
290
|
+
| `EnvFileError` | `AvEnvFileError` |
|
|
291
|
+
| `OutputValidationError` | `AvOutputValidationError` |
|
|
292
|
+
| `OutputWriteError` | `AvOutputWriteError` |
|
|
293
|
+
| `PipeOutputError` | `AvPipeOutputError` |
|
|
294
|
+
| `UnmountedRouteError` | `AvUnmountedRouteError` |
|
|
295
|
+
|
|
296
|
+
`@aventara/testing`:
|
|
297
|
+
|
|
298
|
+
| Before | After |
|
|
299
|
+
| ------------------------ | -------------------------- |
|
|
300
|
+
| `AdapterFactory` | `AvAdapterFactory` |
|
|
301
|
+
| `FakeAdapter` | `AvFakeAdapter` |
|
|
302
|
+
| `FakeAdapterExecute` | `AvFakeAdapterExecute` |
|
|
303
|
+
| `FakeAdapterOptions` | `AvFakeAdapterOptions` |
|
|
304
|
+
| `FakeAdapterRollback` | `AvFakeAdapterRollback` |
|
|
305
|
+
| `FakeTransactionOutcome` | `AvFakeTransactionOutcome` |
|
|
306
|
+
| `FakeTransactionTrace` | `AvFakeTransactionTrace` |
|
|
307
|
+
|
|
308
|
+
`@aventara/client` (the `framework.client.ts` config types):
|
|
309
|
+
|
|
310
|
+
| Before | After |
|
|
311
|
+
| ------------------- | --------------------- |
|
|
312
|
+
| `ClientConfigInput` | `AvClientConfigInput` |
|
|
313
|
+
| `ConfigValue` | `AvClientConfigValue` |
|
|
314
|
+
| `EnvReference` | `AvEnvReference` |
|
|
315
|
+
|
|
316
|
+
`@aventara/prisma7-adapter`: its public types and error classes (`createPrismaAdapter` keeps its name):
|
|
317
|
+
|
|
318
|
+
| Before | After |
|
|
319
|
+
| ---------------------------------- | ------------------------------------ |
|
|
320
|
+
| `PrismaAdapterModel` | `AvPrismaAdapterModel` |
|
|
321
|
+
| `PrismaAdapterOptions` | `AvPrismaAdapterOptions` |
|
|
322
|
+
| `PrismaDelegate` | `AvPrismaDelegate` |
|
|
323
|
+
| `PrismaDelegateHost` | `AvPrismaDelegateHost` |
|
|
324
|
+
| `PrismaDelegateIndex` | `AvPrismaDelegateIndex` |
|
|
325
|
+
| `PrismaDiscoveryArtifact` | `AvPrismaDiscoveryArtifact` |
|
|
326
|
+
| `PrismaDriver` | `AvPrismaDriver` |
|
|
327
|
+
| `PrismaIsolationLevel` | `AvPrismaIsolationLevel` |
|
|
328
|
+
| `PrismaProvider` | `AvPrismaProvider` |
|
|
329
|
+
| `PrismaProviderProfile` | `AvPrismaProviderProfile` |
|
|
330
|
+
| `PrismaReferentialAction` | `AvPrismaReferentialAction` |
|
|
331
|
+
| `PrismaReferentialActionTable` | `AvPrismaReferentialActionTable` |
|
|
332
|
+
| `PrismaReferentialEdge` | `AvPrismaReferentialEdge` |
|
|
333
|
+
| `PrismaResourceReferentialActions` | `AvPrismaResourceReferentialActions` |
|
|
334
|
+
| `PrismaTransactionOptions` | `AvPrismaTransactionOptions` |
|
|
335
|
+
| `PrismaCapabilityDerivationError` | `AvPrismaCapabilityDerivationError` |
|
|
336
|
+
| `PrismaDiscoveryArtifactError` | `AvPrismaDiscoveryArtifactError` |
|
|
337
|
+
| `PrismaEmulationError` | `AvPrismaEmulationError` |
|
|
338
|
+
| `PrismaExecutionError` | `AvPrismaExecutionError` |
|
|
339
|
+
| `PrismaExistenceGateError` | `AvPrismaExistenceGateError` |
|
|
340
|
+
| `PrismaFieldProjectionError` | `AvPrismaFieldProjectionError` |
|
|
341
|
+
| `PrismaGenerateCliError` | `AvPrismaGenerateCliError` |
|
|
342
|
+
| `PrismaGenerateStepError` | `AvPrismaGenerateStepError` |
|
|
343
|
+
| `PrismaModelCompositionError` | `AvPrismaModelCompositionError` |
|
|
344
|
+
| `PrismaMutationTranslationError` | `AvPrismaMutationTranslationError` |
|
|
345
|
+
| `PrismaOperationTranslationError` | `AvPrismaOperationTranslationError` |
|
|
346
|
+
| `PrismaOrderTranslationError` | `AvPrismaOrderTranslationError` |
|
|
347
|
+
| `PrismaProjectionTranslationError` | `AvPrismaProjectionTranslationError` |
|
|
348
|
+
| `PrismaResultShapeError` | `AvPrismaResultShapeError` |
|
|
349
|
+
| `PrismaScalarConversionError` | `AvPrismaScalarConversionError` |
|
|
350
|
+
| `PrismaSchemaReaderError` | `AvPrismaSchemaReaderError` |
|
|
351
|
+
| `PrismaTypesReaderError` | `AvPrismaTypesReaderError` |
|
|
352
|
+
| `PrismaWhereTranslationError` | `AvPrismaWhereTranslationError` |
|
|
353
|
+
|
|
354
|
+
- 9c52482: A `$connect` to a row that does not exist now answers `404 A2003` (not found), the same as reading a missing row.
|
|
355
|
+
Before, it answered `422 A2004`. This covers a to-one `$connect` in `create`, `update` and `upsert`, a to-many
|
|
356
|
+
`$connect`, and the same writes inside a transaction plan, where `cause.operation` names the step. The message is
|
|
357
|
+
unchanged: "The operation's arguments referenced a record that does not exist." On `update.first`, the same mistake
|
|
358
|
+
answered `A2014` before, as if the row had changed underneath; it now answers `A2003` too, and a duplicate unique value
|
|
359
|
+
written through `update.first` answers `409 A2008` instead of `A3001`.
|
|
360
|
+
|
|
361
|
+
Clearer top-level messages for an unknown Resource or operation. `A2001` now says "The requested Resource is not
|
|
362
|
+
available." and `A2002` says "The requested operation is not available on this Resource.", instead of "Operation
|
|
363
|
+
arguments failed framework validation.", which stays the message of `A2004`, `A2007` and `A2009`. A transaction step
|
|
364
|
+
whose operation is outside the standard grammar now carries the same issue message as a single call, naming the
|
|
365
|
+
operation and the Resource (for example `Operation "dance.one" is not available on Resource "posts".`), instead of
|
|
366
|
+
"Operation is not part of the standard operation grammar."
|
|
367
|
+
|
|
368
|
+
A `$ref` with no `fingerprint` is `V1000` (required value missing) and answers `422 A2004`. Before, it was `V1017`
|
|
369
|
+
(fingerprint mismatch) under `A2007`. A fingerprint that is present but wrong is still `V1017`.
|
|
370
|
+
|
|
371
|
+
`aventara init` and `aventara new` link to the documentation at https://aventara-framework.vercel.app. The old
|
|
372
|
+
address redirects, so links already written into projects keep working.
|
|
373
|
+
|
|
374
|
+
- 916e5f6: A stage's `ctx.$sql` outside a transaction is a plain statement: the adapter runs it with `$queryRaw` in its
|
|
375
|
+
tagged form on the base client, with no `BEGIN` around it. Inside a transaction it still runs on the transaction
|
|
376
|
+
client. The adapter now declares `sqlStatements` with every driver, `@prisma/adapter-d1` included: there, with no
|
|
377
|
+
interactive transaction, `ctx.$sql` runs as a plain statement, and a transaction plan stays unavailable. In-process calls
|
|
378
|
+
(`framework.application`, `framework.client`, `framework.transaction`) now resolve data and throw `AvError`
|
|
379
|
+
subclasses (see `@aventara/core`).
|
|
380
|
+
|
|
381
|
+
- Breaking: the discovery artifact states each Resource's create requirements on its model
|
|
382
|
+
(`model.resources.<R>.createRequirements`): `required` columns, `oneOf` required relations with the fields holding
|
|
383
|
+
their reference, and `parentSupplies` for nested creates. The separate `createRequirements` table beside the model is
|
|
384
|
+
removed, and the artifact format is now 3: regenerate the artifact with `npm run aventara:prepare` (or
|
|
385
|
+
`aventara-prisma7-generate`). The model, and so `modelHash` and the Client Contract's hash, change for every schema
|
|
386
|
+
with a required column or relation. Required create fields are now typed in every create call (see
|
|
387
|
+
`@aventara/core`).
|
|
388
|
+
|
|
389
|
+
- Updated dependencies [800123b]
|
|
390
|
+
- Updated dependencies [8bb1d6a]
|
|
391
|
+
- Updated dependencies [68d4395]
|
|
392
|
+
- Updated dependencies [7e3d06f]
|
|
393
|
+
- Updated dependencies [1b5d3c0]
|
|
394
|
+
- Updated dependencies [6317811]
|
|
395
|
+
- Updated dependencies [6d0e5d6]
|
|
396
|
+
- Updated dependencies [7a0cab9]
|
|
397
|
+
- Updated dependencies [eb2a718]
|
|
398
|
+
- Updated dependencies [03312c5]
|
|
399
|
+
- Updated dependencies [123f6dc]
|
|
400
|
+
- Updated dependencies [b65df2e]
|
|
401
|
+
- Updated dependencies [c6e5010]
|
|
402
|
+
- Updated dependencies [c1f9389]
|
|
403
|
+
- Updated dependencies [9c52482]
|
|
404
|
+
- Updated dependencies [8396148]
|
|
405
|
+
- Updated dependencies [e8fbb02]
|
|
406
|
+
- Updated dependencies [916e5f6]
|
|
407
|
+
- Updated dependencies [6cbd158]
|
|
408
|
+
- @aventara/core@1.0.0-rc.1
|
|
409
|
+
|
|
410
|
+
## 1.0.0-rc.0
|
|
411
|
+
|
|
412
|
+
### Major Changes
|
|
413
|
+
|
|
414
|
+
- First release candidate of Aventara 1.0. The public API is now considered stable; changes before 1.0.0 are possible
|
|
415
|
+
based on feedback.
|
|
416
|
+
|
|
417
|
+
### Minor Changes
|
|
418
|
+
|
|
419
|
+
- 24ffbab: A nested `$update` or `$delete` through a to-many relation filters plain fields only on Prisma 7, and Aventara now says
|
|
420
|
+
so up front: a relation filter in its `where` — `{ posts: { $update: { where: { category: { name: "x" } }, … } } }`, at
|
|
421
|
+
any depth, under `AND`/`OR`/`NOT` too — is refused with `A2004` / `V1006` before the database is asked, and is a type
|
|
422
|
+
error in `framework.application`, `framework.client`, `appTx`/`clientTx` and the generated client. Before, it reached
|
|
423
|
+
Prisma and fail as `A3001`. A to-one relation's nested filter keeps relation filters. The limit is stated by the adapter
|
|
424
|
+
in the Contract (`nestedWriteFilter: "scalar"`), so the ClientContract hash changes: regenerate the client.
|
|
425
|
+
|
|
426
|
+
### Patch Changes
|
|
427
|
+
|
|
428
|
+
- 24ffbab: Each package ships its `CHANGELOG.md`, so the release notes are in the installed package beside the README.
|
|
429
|
+
- a973e89: A write that sets an optional relation both ways — its reference field and the relation itself, such as `categoryId`
|
|
430
|
+
and `category: { $connect: … }` in the same record — is now refused before it reaches the database, exactly like a
|
|
431
|
+
required relation: `A2004` with a `V1012` issue at the relation, message `Set "categoryId" or "category", not both.`
|
|
432
|
+
Before, the database refused it and the caller received `A3001`. It applies to `create`, `update` and `upsert`, to
|
|
433
|
+
nested writes at any depth, and to each step of a transaction.
|
|
434
|
+
|
|
435
|
+
The discovery artifact now records, for each relation, the fields that hold its reference (`references` on each edge
|
|
436
|
+
of `referentialActions`), and a create requirement no longer repeats them. Regenerate your artifact with
|
|
437
|
+
`npm run aventara:prepare` (or `aventara-prisma7-generate`); an artifact from an earlier version is refused with a
|
|
438
|
+
message that says so. An adapter's `referentialActions` edges carry the same `references` member.
|
|
439
|
+
|
|
440
|
+
- a973e89: With the Prisma adapter, a record that writes one relation through its reference field and another relation directly —
|
|
441
|
+
such as `authorId` beside `category: { $connect: … }` — is now refused before it reaches the database: `A2004` with a
|
|
442
|
+
`V1012` issue at the relation write, message
|
|
443
|
+
`Use relation fields only, or reference fields only, in one record: "authorId" is a reference field and "category" is a relation.`
|
|
444
|
+
Before, Prisma refused it and the caller received `A3001`. Write the record's relations all as relations
|
|
445
|
+
(`author: { $connect: … }, category: { $connect: … }`) or all through their fields (`authorId`, `categoryId`). A
|
|
446
|
+
reference field beside a relation that holds no reference on that side — `mentorId` beside `posts: { $create: … }` on
|
|
447
|
+
an author — is unchanged and still accepted. It applies to `create`, `update` and `upsert`, to nested writes at any
|
|
448
|
+
depth, and to each step of a transaction.
|
|
449
|
+
|
|
450
|
+
The limit is part of the Contract: a Contract whose data source has it carries `referenceWrites: "uniform"`, so the
|
|
451
|
+
Contract hash of every Prisma-backed application changes. Regenerate your discovery artifact
|
|
452
|
+
(`npm run aventara:prepare`) and your generated client (`avclient generate`). An adapter states the limit with
|
|
453
|
+
`referenceWrites: "uniform"` in its model; without it, nothing changes.
|
|
454
|
+
|
|
455
|
+
- Updated dependencies [24ffbab]
|
|
456
|
+
- Updated dependencies [24ffbab]
|
|
457
|
+
- Updated dependencies [24ffbab]
|
|
458
|
+
- Updated dependencies [24ffbab]
|
|
459
|
+
- Updated dependencies [24ffbab]
|
|
460
|
+
- Updated dependencies [24ffbab]
|
|
461
|
+
- Updated dependencies [24ffbab]
|
|
462
|
+
- Updated dependencies [24ffbab]
|
|
463
|
+
- Updated dependencies [24ffbab]
|
|
464
|
+
- Updated dependencies [24ffbab]
|
|
465
|
+
- Updated dependencies [24ffbab]
|
|
466
|
+
- Updated dependencies [24ffbab]
|
|
467
|
+
- Updated dependencies [a973e89]
|
|
468
|
+
- Updated dependencies [1e65e9a]
|
|
469
|
+
- Updated dependencies
|
|
470
|
+
- Updated dependencies [a973e89]
|
|
471
|
+
- Updated dependencies [a973e89]
|
|
472
|
+
- Updated dependencies [1e65e9a]
|
|
473
|
+
- Updated dependencies [1e65e9a]
|
|
474
|
+
- Updated dependencies [24ffbab]
|
|
475
|
+
- Updated dependencies [2d00ad7]
|
|
476
|
+
- Updated dependencies [384a50c]
|
|
477
|
+
- Updated dependencies [d43d1cc]
|
|
478
|
+
- Updated dependencies [3f98749]
|
|
479
|
+
- Updated dependencies [032f792]
|
|
480
|
+
- Updated dependencies [dbe6961]
|
|
481
|
+
- @aventara/core@1.0.0-rc.0
|
|
482
|
+
|
|
483
|
+
## 0.1.0-pilot.4
|
|
484
|
+
|
|
485
|
+
### Patch Changes
|
|
486
|
+
|
|
487
|
+
- f37dcd6: A discovery artifact written by an older version of the adapter now fails the TypeScript build with an error that
|
|
488
|
+
says what to do: `Property 'regenerate_with_aventara_prepare' is missing`. Run `npm run aventara:prepare`
|
|
489
|
+
(or `aventara-prisma7-generate`) to regenerate it. Every newly generated artifact carries the property, and
|
|
490
|
+
`createPrismaAdapter` refuses an out-of-date artifact at startup with the same instruction.
|
|
491
|
+
- f37dcd6: The documentation shipped with the package — the comments an editor shows on hover, and the README — now describes
|
|
492
|
+
what each export does, how to use it, what it returns and what it throws. Notes about how the package was built and
|
|
493
|
+
why are no longer part of what is published.
|
|
494
|
+
|
|
495
|
+
The generate step's error messages name "the generated client's types" in words instead of Prisma's emoji labels.
|
|
496
|
+
|
|
497
|
+
- Updated dependencies [f37dcd6]
|
|
498
|
+
- @aventara/core@0.1.0-pilot.4
|
|
499
|
+
|
|
500
|
+
## 0.1.0-pilot.3
|
|
501
|
+
|
|
502
|
+
### Patch Changes
|
|
503
|
+
|
|
504
|
+
- The manifest declares the adapter's CLI alias, `aventara.adapter.alias: "prisma7"`: the value `aventara new --orm` and `aventara init --orm` take.
|
|
505
|
+
- @aventara/core@0.1.0-pilot.3
|
|
506
|
+
|
|
507
|
+
## 0.1.0-pilot.2
|
|
508
|
+
|
|
509
|
+
### Patch Changes
|
|
510
|
+
|
|
511
|
+
- e69e88d: The published packages are written for the people who use them. The JavaScript ships without comments; the type
|
|
512
|
+
declarations keep their documentation, and it, the error messages, the protocol fixtures' labels and the comments in a
|
|
513
|
+
generated client no longer carry the project's internal development notes.
|
|
514
|
+
- 06ed5d8: A relation write that would leave a child without the parent its required relation demands — `$set: []` or
|
|
515
|
+
`$disconnect` on a to-many whose children require the parent — now answers `A2008` (the same conflict a violated
|
|
516
|
+
reference constraint answers) instead of `A3001`. Nothing is written.
|
|
517
|
+
- 23937f8: A create that lacks a value the database requires is refused as `A2004` with a `V1000` issue at the value's path,
|
|
518
|
+
instead of reaching the database and answering `A3001`. It covers `create.one`, every row of `create.many`, `upsert`'s
|
|
519
|
+
`create` branch, nested `$create` (and `$connectOrCreate`/`$upsert` creates) at any depth, and transaction steps
|
|
520
|
+
(`["operations", i, "args", …]`). A required relation is satisfied by writing it or every scalar that holds its
|
|
521
|
+
reference; a nested create never needs the relation it is created through. Defaults, `@updatedAt`, autoincrement,
|
|
522
|
+
optional and list columns are never required. The check runs after pipes and computed behaviours, so a value they
|
|
523
|
+
supply counts.
|
|
524
|
+
|
|
525
|
+
An adapter states the requirements through the new optional `Adapter.createRequirements`; the Prisma 7 adapter reads
|
|
526
|
+
them from the generated client's create inputs at generate time and records them in the discovery artifact, so the
|
|
527
|
+
artifact must be regenerated (`aventara:prepare`).
|
|
528
|
+
|
|
529
|
+
- 287fc27: A discovery artifact older than the Prisma client is refused at startup. The artifact now records the client it was
|
|
530
|
+
generated from (each model and its field references), and `createPrismaAdapter` — which runs before the application
|
|
531
|
+
listens — compares that record with the client it is given: a model or field added, removed or renamed since the
|
|
532
|
+
artifact was generated stops the server with one sentence naming the difference and `aventara:prepare`. An artifact
|
|
533
|
+
generated by an earlier version carries no record and is refused with the same instruction; a project set up by
|
|
534
|
+
`aventara` regenerates it on install.
|
|
535
|
+
- Updated dependencies [c2a3b7c]
|
|
536
|
+
- Updated dependencies [e69e88d]
|
|
537
|
+
- Updated dependencies [ab58424]
|
|
538
|
+
- Updated dependencies [23937f8]
|
|
539
|
+
- @aventara/core@0.1.0-pilot.2
|
|
540
|
+
|
|
541
|
+
## 0.1.0-pilot.1
|
|
542
|
+
|
|
543
|
+
### Patch Changes
|
|
544
|
+
|
|
545
|
+
- 799346e: The package READMEs (each package's npm page) are rewritten for the people who use the packages. The Prisma 7
|
|
546
|
+
adapter's README now states the actual behaviour of a to-many relation or `$count` projected on
|
|
547
|
+
`update.many`/`create.many`: a validation refusal, `A2004` with `V1008`, before any statement runs (it said `A3001`).
|
|
548
|
+
Every install or run command names the `@pilot` dist-tag.
|
|
549
|
+
- Updated dependencies [a45f8a8]
|
|
550
|
+
- Updated dependencies [799346e]
|
|
551
|
+
- @aventara/core@0.1.0-pilot.1
|
|
552
|
+
|
|
553
|
+
## 0.1.0-pilot.0
|
|
554
|
+
|
|
555
|
+
### Minor Changes
|
|
556
|
+
|
|
557
|
+
- First pilot release of `@aventara/prisma7-adapter`, the Prisma 7 adapter. Peers: `@prisma/client`, `prisma` and the
|
|
558
|
+
driver adapters `^7.10.0`; `typescript` `>=5.5.0 <7` for the generate step. `typescript` and `prisma` are optional
|
|
559
|
+
peers used only by the generate step, so neither enters a deployed install.
|
|
560
|
+
|
|
561
|
+
- **`createPrismaAdapter({ client, discovery, provider, driver, transactionOptions? })`** is the entry point. Your
|
|
562
|
+
application owns the Prisma client, built with a driver adapter; the adapter never builds one, reads a connection
|
|
563
|
+
string or reads an environment variable. `provider` and `driver` are stated by you, and the driver decides whether
|
|
564
|
+
transactions are offered. It is `async` because it verifies the discovery artifact.
|
|
565
|
+
- **Discovery runs at generate time.** `aventara-prisma7-generate` (or the `@aventara/prisma7-adapter/generate`
|
|
566
|
+
export) reads `schema.prisma` and the generated client's types and writes one module, the discovery artifact: the
|
|
567
|
+
model, how each Resource is addressed, its referential actions, a `modelHash` and the Prisma version. At startup the
|
|
568
|
+
adapter checks that the artifact matches its `modelHash` and that the installed `@prisma/client` major is the one it
|
|
569
|
+
was generated against, and stops with an instruction to regenerate otherwise. The artifact is rewritten only when its
|
|
570
|
+
bytes change, and replaced atomically, so a reader never sees a half-written file.
|
|
571
|
+
- **The Contract says what Prisma serves.** `createMany`/`updateMany` results project fewer relations than a read
|
|
572
|
+
(the rule is which side holds the foreign key, not cardinality); the Contract advertises that per argument position,
|
|
573
|
+
and an out-of-position projection or nested write is refused with `A2004` (`V1008` / `V1006`) before any query.
|
|
574
|
+
- **Cascading deletes.** The schema's referential actions are stated to the Framework, so a transaction step that
|
|
575
|
+
depends on rows an earlier step's cascading delete removed is refused before the plan runs (`A2004`/`V1019`).
|
|
576
|
+
- **Conflicts are told apart:** `A2008 CONFLICT` for a uniqueness or reference constraint, `A2013
|
|
577
|
+
CONCURRENT_MODIFICATION` when another operation changed the same state, `A2014 STALE_SELECTION` when the selected
|
|
578
|
+
record changed before the write.
|
|
579
|
+
- **Behaviours to know:**
|
|
580
|
+
- `delete.many` is not offered (Prisma 7 has no `deleteManyAndReturn`); use `delete.count`.
|
|
581
|
+
- `update.first` and `delete.first` are a read followed by a write narrowed to the record the read selected, and are
|
|
582
|
+
not atomic: the record written is one the read selected, or nothing is written and you are told (`A2014`). A
|
|
583
|
+
record that comes to sort first between the two statements is not seen. If firstness at the instant of the write
|
|
584
|
+
matters, select the record yourself and use `update.unique`/`delete.unique`.
|
|
585
|
+
- A serialization failure (`P2034`) is never retried automatically: a retry would re-run your pipeline callbacks.
|
|
586
|
+
Retrying is yours to decide.
|
|
587
|
+
- Whether transactions are offered depends on the driver and is part of the ClientContract hash, so generate the
|
|
588
|
+
client against the deployment's own driver.
|
|
589
|
+
- No raw SQL is ever issued.
|
|
590
|
+
- PostgreSQL and SQLite are supported.
|
|
591
|
+
- Every export has a `default` condition, so a CommonJS project can `require()` it. The manifest declares what the
|
|
592
|
+
adapter supports (providers, drivers, generators), which `@aventara/cli` reads.
|
|
593
|
+
|
|
594
|
+
### Patch Changes
|
|
595
|
+
|
|
596
|
+
- Updated dependencies
|
|
597
|
+
- @aventara/core@0.1.0-pilot.0
|