docs: add Column Codecs page#300
Draft
arv wants to merge 1 commit into
Draft
Conversation
Document the `.codec()` schema builder API: storage-type vs app-type columns, automatic decode on read and encode on write/filter, custom codec examples (JSON-backed class, Zod 4.1 codecs), and behavior in query results, filtering, ordering, and mutations. Add a nav entry under Schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new Column Codecs documentation page (contents/docs/codecs.mdx) and a nav entry under Schema.
The page documents the
.codec()schema builder API from rocicorp/mono#6087:.codec()API — storage type vs app type,decode(read) /encode(write + filter), and that the type parameter is the app-side type.z.codec()directly.whereencodes app values), ordering (sorts on raw storage values), and mutations (encode on write).Why
.codec()is a new schema feature with no docs yet. This gives users a single reference for how stored vs app types work and how codecs interact with reads, writes, filters, and ordering.Notes for reviewers
@rocicorp/zerotypes, and Zod 4.4.3's type defs (thez.codec()object really does expose synchronous.decode()/.encode()methods that match Zero's expected shape).useQueryfor both React and Solid, consistent with the rest of the docs (createQueryis deprecated in the Solid bindings).null/undefinedbypass the codec, so codec functions only handle real values and compose with.optional().Temporal.Instantas the running example;Temporalstill needs a polyfill in most current runtimes. Left as-is for now — flagging in case we'd rather lead with a plainDatecodec.🤖 Generated with Claude Code