Skip to content

feat: native Date/Map/Set Encoded; query adapters convert to JSON - #874

Open
omegent-app[bot] wants to merge 4 commits into
mainfrom
feat/query-native-encoded-types
Open

feat: native Date/Map/Set Encoded; query adapters convert to JSON#874
omegent-app[bot] wants to merge 4 commits into
mainfrom
feat/query-native-encoded-types

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Schema.Date, ReadonlySet, and ReadonlyMap no longer rewrite Encoded to JSON (string / array). Encoded is the native value (Date / Set / Map).

The query DSL already types filter values as Encoded, so where("n", "gt", new Date(...)) typechecks. Document-store adapters convert those values to JSON when building queries:

  • Date → ISO string (Schema.toCodecJson(Schema.Date))
  • Set → array
  • Map → array of entries

Repository persistence also round-trips through Schema.toCodecJson, so Cosmos / SQL / disk JSON documents stay compatible.

JSON Encoded codecs remain as explicit helpers: DateFromString, ReadonlySetFromArray, ReadonlyMapFromArray. OmegaForm date inputs that take strings should use DateFromString.

Breaking

  • S.Date Encoded is Date, not string
  • S.ReadonlySet Encoded is Set, not array
  • S.ReadonlyMap Encoded is Map, not array of tuples
  • Query filters on those fields take native values, not JSON

opened by patroza in chat thread Discord · Discord · T3


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

omegent-app Bot and others added 2 commits August 22, 2026 08:20
Query filters now take Date/Set/Map values. Cosmos/SQL/memory adapters
lower those to JSON (ISO strings, arrays, entries), and repository
persistence round-trips through Schema.toCodecJson.

Use DateFromString / ReadonlySetFromArray / ReadonlyMapFromArray when
Encoded must be JSON.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app
omegent-app Bot marked this pull request as ready for review August 22, 2026 08:22
@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/effect-app/libs/@effect-app/cli@874

effect-app

npm i https://pkg.pr.new/effect-app/libs/effect-app@874

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-codegen-model@874

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-shared-config@874

@effect-app/infra

npm i https://pkg.pr.new/effect-app/libs/@effect-app/infra@874

@effect-app/vue

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue@874

@effect-app/vue-components

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue-components@874

commit: 216816c

omegent-app Bot and others added 2 commits August 22, 2026 09:25
Unwrap ReadonlySet in includes/includes-any and accept Set or array
needles for in. Adapters already JSON-convert those values.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Memory and Disk now convert documents with Schema.toCodecJson(toEncoded)
instead of JSON.parse/stringify (which dropped Map/Set). SQL and Cosmos
use the same codec on write/read. Repository encode stays Type→Encoded;
adapters own JSON.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants