From 6259177a185779d0fbfa52c99f213c3b2bc70d06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 09:55:36 +0000 Subject: [PATCH] chore: version packages --- .changeset/arith-argument-parens.md | 5 ----- .changeset/ch-array-literal-cast.md | 5 ----- .changeset/exact-number-literals.md | 5 ----- .changeset/fromquery-select-all.md | 5 ----- .changeset/pg-typed-placeholders.md | 5 ----- .changeset/typed-errors-not-throws.md | 5 ----- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 8 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 .changeset/arith-argument-parens.md delete mode 100644 .changeset/ch-array-literal-cast.md delete mode 100644 .changeset/exact-number-literals.md delete mode 100644 .changeset/fromquery-select-all.md delete mode 100644 .changeset/pg-typed-placeholders.md delete mode 100644 .changeset/typed-errors-not-throws.md diff --git a/.changeset/arith-argument-parens.md b/.changeset/arith-argument-parens.md deleted file mode 100644 index 76e0e01..0000000 --- a/.changeset/arith-argument-parens.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -An arithmetic expression passed as an argument keeps its parentheses: `$.a.sub($.b.add(1))` compiles to `a - (b + 1)`, not `a - b + 1`. Chains still follow SQL precedence as documented (`$.a.sub(1).div(2)` is `a - 1 / 2`); passing the group as an argument is how to group. diff --git a/.changeset/ch-array-literal-cast.md b/.changeset/ch-array-literal-cast.md deleted file mode 100644 index 0f187c9..0000000 --- a/.changeset/ch-array-literal-cast.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -On ClickHouse, an array or map compared against a column is cast to the column's type: `$.Ids.eq([0, 4294967296])` writes `CAST([0, 4294967296] AS Array(Nullable(Int64)))`. Uncast, ClickHouse inferred the literal's element type from its values (`Array(UInt64)` here) and could refuse the comparison with `ILLEGAL_TYPE_OF_ARGUMENT`. diff --git a/.changeset/exact-number-literals.md b/.changeset/exact-number-literals.md deleted file mode 100644 index 69a776f..0000000 --- a/.changeset/exact-number-literals.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -ClickHouse number literals read back as exactly the value you passed. A subnormal float (`5e-324`) was a syntax error and is now written from its bits; a whole number past 2^53 (`44812297868494010`) was written as its shortest decimal, which ClickHouse parses as a different integer, so `WHERE x = value` could miss the row — it is now written as the double's exact integer value. diff --git a/.changeset/fromquery-select-all.md b/.changeset/fromquery-select-all.md deleted file mode 100644 index 58ed7f7..0000000 --- a/.changeset/fromquery-select-all.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -A bare `select()` over a subquery or union (`CH.fromQuery(inner, "w").select()`, `CH.fromUnion(union, "u").select()`) selects every alias the source selects, as its type already said. It died with `QueryBuilderDefect: select() is required`, because the derived source has no column list until its own SELECT is evaluated. diff --git a/.changeset/pg-typed-placeholders.md b/.changeset/pg-typed-placeholders.md deleted file mode 100644 index 9818989..0000000 --- a/.changeset/pg-typed-placeholders.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -Two Postgres values the server typed wrong from context now compile correctly. A `param.of(type)` selected on its own is written `CAST($n AS )`, so a boolean or array comes back as itself instead of text that fails to decode. A fractional value compared with an integer column binds as `$n::numeric` instead of failing with `invalid input syntax for type bigint`. Nothing else is cast: whole numbers, params compared with columns, inserts and `real` columns keep untyped placeholders (and their indexes). `param.of` also no longer confuses two types that share a codec (`int8` and `float8`). diff --git a/.changeset/typed-errors-not-throws.md b/.changeset/typed-errors-not-throws.md deleted file mode 100644 index d247486..0000000 --- a/.changeset/typed-errors-not-throws.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@maple-dev/effect-orm": patch ---- - -Values that cannot become SQL fail compilation with a `QueryBuilderError` (`InvalidLiteral`) instead of throwing: a bigint compared against a non-integer column, a non-string `like`/`notLike`/`ilike` pattern, `lit()` of anything but a string or number (it wrote `[object Object]`), a non-numeric arithmetic operand, an invalid `Date`, and an unparseable string or invalid `Date` for a Postgres timestamp. A non-expression in a `select` record is a `QueryBuilderDefect` naming the alias, like a malformed `orderBy`. diff --git a/CHANGELOG.md b/CHANGELOG.md index bef74a2..e44dd99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # @maple-dev/effect-orm +## 0.7.2 + +### Patch Changes + +- 36499ea: An arithmetic expression passed as an argument keeps its parentheses: `$.a.sub($.b.add(1))` compiles to `a - (b + 1)`, not `a - b + 1`. Chains still follow SQL precedence as documented (`$.a.sub(1).div(2)` is `a - 1 / 2`); passing the group as an argument is how to group. +- 0bf4dbc: On ClickHouse, an array or map compared against a column is cast to the column's type: `$.Ids.eq([0, 4294967296])` writes `CAST([0, 4294967296] AS Array(Nullable(Int64)))`. Uncast, ClickHouse inferred the literal's element type from its values (`Array(UInt64)` here) and could refuse the comparison with `ILLEGAL_TYPE_OF_ARGUMENT`. +- 1aee63f: ClickHouse number literals read back as exactly the value you passed. A subnormal float (`5e-324`) was a syntax error and is now written from its bits; a whole number past 2^53 (`44812297868494010`) was written as its shortest decimal, which ClickHouse parses as a different integer, so `WHERE x = value` could miss the row — it is now written as the double's exact integer value. +- 362e880: A bare `select()` over a subquery or union (`CH.fromQuery(inner, "w").select()`, `CH.fromUnion(union, "u").select()`) selects every alias the source selects, as its type already said. It died with `QueryBuilderDefect: select() is required`, because the derived source has no column list until its own SELECT is evaluated. +- 4f690ed: Two Postgres values the server typed wrong from context now compile correctly. A `param.of(type)` selected on its own is written `CAST($n AS )`, so a boolean or array comes back as itself instead of text that fails to decode. A fractional value compared with an integer column binds as `$n::numeric` instead of failing with `invalid input syntax for type bigint`. Nothing else is cast: whole numbers, params compared with columns, inserts and `real` columns keep untyped placeholders (and their indexes). `param.of` also no longer confuses two types that share a codec (`int8` and `float8`). +- ed8f7b4: Values that cannot become SQL fail compilation with a `QueryBuilderError` (`InvalidLiteral`) instead of throwing: a bigint compared against a non-integer column, a non-string `like`/`notLike`/`ilike` pattern, `lit()` of anything but a string or number (it wrote `[object Object]`), a non-numeric arithmetic operand, an invalid `Date`, and an unparseable string or invalid `Date` for a Postgres timestamp. A non-expression in a `select` record is a `QueryBuilderDefect` naming the alias, like a malformed `orderBy`. + ## 0.7.1 ### Patch Changes diff --git a/package.json b/package.json index 12547cc..079ebcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maple-dev/effect-orm", - "version": "0.7.1", + "version": "0.7.2", "description": "Type-safe ClickHouse and Postgres queries, result decoding, and reproducible benchmarks for Effect and TypeScript", "keywords": [ "clickhouse",