diff --git a/.changeset/coalesce-fallback-inference.md b/.changeset/coalesce-fallback-inference.md deleted file mode 100644 index d771d5f..0000000 --- a/.changeset/coalesce-fallback-inference.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@evryg/effect-cypher-codegen": patch ---- - -coalesce now accounts for fallback argument types when the leading argument is nullable. Previously the result type was the leading argument's type stripped of nullable, ignoring the fallbacks. When a nullable Double property is coalesced with an integer literal (`coalesce(n.score, 0)`), the runtime yields that integer literal as a database Integer when the property is null — which the Double decoder rejects. The result now widens to Long (the integer-tolerant numeric superset, which also passes floats through), so the emitted column decodes correctly. Same-type and non-nullable leading arguments are unaffected. diff --git a/packages/cypher-codegen/CHANGELOG.md b/packages/cypher-codegen/CHANGELOG.md index 9d87bf4..1d962b7 100644 --- a/packages/cypher-codegen/CHANGELOG.md +++ b/packages/cypher-codegen/CHANGELOG.md @@ -1,5 +1,11 @@ # @evryg/effect-cypher-codegen +## 0.4.2 + +### Patch Changes + +- [#86](https://github.com/evryg-org/effect-contrib/pull/86) [`5c1c286`](https://github.com/evryg-org/effect-contrib/commit/5c1c2864d01f6f4c975c4cd1b2cd917bd207adae) Thanks @jbmusso! - coalesce now accounts for fallback argument types when the leading argument is nullable. Previously the result type was the leading argument's type stripped of nullable, ignoring the fallbacks. When a nullable Double property is coalesced with an integer literal (`coalesce(n.score, 0)`), the runtime yields that integer literal as a database Integer when the property is null — which the Double decoder rejects. The result now widens to Long (the integer-tolerant numeric superset, which also passes floats through), so the emitted column decodes correctly. Same-type and non-nullable leading arguments are unaffected. + ## 0.4.1 ### Patch Changes diff --git a/packages/cypher-codegen/package.json b/packages/cypher-codegen/package.json index 704d967..2e19a37 100644 --- a/packages/cypher-codegen/package.json +++ b/packages/cypher-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@evryg/effect-cypher-codegen", - "version": "0.4.1", + "version": "0.4.2", "type": "module", "license": "MIT", "description": "Cypher type checker and code generator: parses .cypher files, infers types, and generates typed Effect modules",