From 3c4c2c23612ec95f48e3f4085b8967002efd9338 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Tue, 3 Nov 2026 03:19:49 +0100 Subject: [PATCH 1/2] docs: release notes for interface-database 0.3.0 --- UPGRADING.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 UPGRADING.md diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..1dad63e --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,9 @@ +# Upgrade notes + +Each section is the upgrade-notes block of one release. Paste it into the GitHub release body and under the release's heading in `CHANGELOG.md`. The changelog generator writes only commit subjects, and some of these changes have no `!` in theirs. + +## v0.3.0 + +- **`update()` with an `any`-typed argument resolves to `never`.** Reading its result, for example `.run()`, fails to compile (TS2339). A function argument still matches only the updater overload and an object argument only the document overload, so typed calls are unchanged. Unchecked `any` writes become compile errors. `ReturnType` is now `Query`, so `await ...run()` is a `number` instead of `any` ([#65](https://github.com/AntelopeJS/interface-database/pull/65)). +- **The entries of a `FieldType` codec are typed `unknown`.** `IoTsCodec` is now a type alias with the same members, so `Object.entries` on a codec gives `[string, unknown]` instead of `[string, any]`. A consumer that passed those entries on as `FieldType` stops compiling. Narrow each entry first. Every value assignable to `FieldType` before still is ([#63](https://github.com/AntelopeJS/interface-database/pull/63)). +- **Stage operands.** A generic `T` operand, or a class instance with methods such as `ObjectId`, no longer compiles as a stage operand. `any` stays `any`. From 6fbe3722dafea9eefb9ab9320ef9803bd155f5fe Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Tue, 3 Nov 2026 03:49:41 +0100 Subject: [PATCH 2/2] docs: cover every breaking change in the interface-database 0.3.0 release notes --- UPGRADING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index 1dad63e..301f7ed 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -6,4 +6,6 @@ Each section is the upgrade-notes block of one release. Paste it into the GitHub - **`update()` with an `any`-typed argument resolves to `never`.** Reading its result, for example `.run()`, fails to compile (TS2339). A function argument still matches only the updater overload and an object argument only the document overload, so typed calls are unchanged. Unchecked `any` writes become compile errors. `ReturnType` is now `Query`, so `await ...run()` is a `number` instead of `any` ([#65](https://github.com/AntelopeJS/interface-database/pull/65)). - **The entries of a `FieldType` codec are typed `unknown`.** `IoTsCodec` is now a type alias with the same members, so `Object.entries` on a codec gives `[string, unknown]` instead of `[string, any]`. A consumer that passed those entries on as `FieldType` stops compiling. Narrow each entry first. Every value assignable to `FieldType` before still is ([#63](https://github.com/AntelopeJS/interface-database/pull/63)). -- **Stage operands.** A generic `T` operand, or a class instance with methods such as `ObjectId`, no longer compiles as a stage operand. `any` stays `any`. +- **Stage operands are checked as query values.** A generic `T` operand, or a class instance with methods such as `ObjectId`, no longer compiles as a stage operand. Neither does an operand that holds a `bigint`, a `symbol`, a function or a value typed `unknown`. `eq`, `ne`, `gt`, `ge`, `lt`, `le` and `includes` check their operand against the receiver's type. `constant`, `default`, `sub`, `merge` and the default of `key` refuse an `interface`-typed record: declare it with `type`. A generic `K extends keyof T` no longer compiles as a `ValueProxy.key`. `any` stays `any` ([#62](https://github.com/AntelopeJS/interface-database/pull/62)). +- **Query stages are typed by name.** `QueryStage` is a union discriminated on `stage`, built from the new exported `QueryStageMap`, and `QueryStage(name, options, ...args)` is typed by name. The protected `StagedObject#stage(type, stage)` takes a built `QueryStage`. `ValueProxy#eq` and `#ne` take `StagedObject | T` instead of `unknown`. `pluck` answers `Pick` and `without` answers `Omit`. Key, table, index and field names are `keyof T & string`. `Table#between` bounds are `T[TK] & IndexBound`, so a field that holds no index value stops compiling as a bound. `ValueProxy#add` takes an operand that fits its receiver, so two dates, or a string on a number, stop at compile time ([#51](https://github.com/AntelopeJS/interface-database/pull/51)). +- **Written documents are typed as write values.** `DeepPartial` drops `bigint` and `symbol` leaves, maps a field typed `unknown` to `WriteValue`, keeps a field typed `any` as `any`, and maps any other non-object type to `never`. The `insert`, `update` and `replace` builders compile only while every leaf of the document is a `WriteValue`: text, a number, a boolean, `null`, `undefined`, a `Date`, a list or a nested document ([#59](https://github.com/AntelopeJS/interface-database/pull/59)).