@bjornpagen/bumbledb 0.12.2 → 0.14.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/src/relation.ts CHANGED
@@ -7,29 +7,15 @@
7
7
  * verified against their roster at construction). Fields are addressed by
8
8
  * NAME everywhere — statements (`on(R, "holder")`), selections, and match
9
9
  * records all spell the field's own name, checked by type
10
- * (`FaceFields`/`MatchShape`). `Fact<>`/`InsertFact<>` are the inferred
11
- * row object types at BARE structural value types (no brands): fresh
12
- * fields are optional on insert input (omit-to-mint) and present on read
13
- * (resupply-to-preserve-identity), typed exactly.
10
+ * (`FaceFields`/`MatchShape`). `Fact<>` is the inferred row object type
11
+ * at BARE structural value types (no brands): every field is present,
12
+ * including fresh cells. Mint with `tx.reserve` before insert.
14
13
  */
15
14
 
16
15
  import * as errors from "@superbuilders/errors"
17
16
  import { type AnyField, assertDeclarationOrderKey, assertDeclarationRecord, type Infer, literalOf } from "#fields.ts"
18
17
  import { type LiteralSetSpec, type LiteralSpec, renderLiteral } from "#spec.ts"
19
18
 
20
- /** Flattens an intersection into one displayed object type (hover legibility). */
21
- type Flatten<T> = { [K in keyof T]: T[K] }
22
-
23
- /**
24
- * An optional property that may be omitted OR explicitly `undefined`.
25
- * `Partial<T>` under `exactOptionalPropertyTypes` is omit-only (`key?: T`),
26
- * which rejects `key: T | undefined` — insert must accept both (omit-to-mint,
27
- * and a host binding that is already `bigint | undefined`).
28
- */
29
- type ExactOptional<T> = {
30
- [K in keyof T]?: T[K] | undefined
31
- }
32
-
33
19
  /**
34
20
  * Resolves one selection entry to its lowered literal set: a plain ARRAY
35
21
  * (detected by `Array.isArray` — no field's value type is an array;
@@ -187,16 +173,6 @@ type FreshKeys<R extends AnyRelation> = {
187
173
  [K in keyof RelationFields<R>]: RelationFields<R>[K] extends { readonly fresh: true } ? K : never
188
174
  }[keyof RelationFields<R>]
189
175
 
190
- /**
191
- * The inferred row object type of a relation as INSERTED: fresh fields
192
- * optional — omitted, the engine mints; supplied, identity is preserved
193
- * (the ETL resupply idiom). Explicit `undefined` is the same as omit
194
- * (`exactOptionalPropertyTypes`: `id?: bigint | undefined`, not omit-only).
195
- */
196
- type InsertFact<R extends AnyRelation> = Flatten<
197
- Omit<Fact<R>, FreshKeys<R>> & ExactOptional<Pick<Fact<R>, FreshKeys<R>>>
198
- >
199
-
200
176
  /**
201
177
  * Declares one relation: `relation("Account", { id: u64.fresh,
202
178
  * holder: u64, kind: Kind.id, ... })` — every field is a pure-structure
@@ -241,7 +217,6 @@ export type {
241
217
  Fact,
242
218
  FieldsShape,
243
219
  FreshKeys,
244
- InsertFact,
245
220
  Relation,
246
221
  RelationData,
247
222
  RelationField,