Document UUID → UInt128 insert patterns with round-trip assertion#780
Open
Copilot wants to merge 3 commits into
Open
Document UUID → UInt128 insert patterns with round-trip assertion#780Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
|
|
Copilot
AI
changed the title
[WIP] Fix UUID parsing/conversion into uint128 during insertion
Document UUID → UInt128 insert patterns for JSONEachRow
May 29, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Copilot
AI
changed the title
Document UUID → UInt128 insert patterns for JSONEachRow
Document UUID → UInt128 insert patterns with round-trip assertion
May 30, 2026
peter-leonov-ch
approved these changes
May 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Node and Web examples documenting how to insert UUID-derived values into UInt128 columns through JSON formats, including assertions that both supported patterns round-trip to the same stored value.
Changes:
- Adds client-side UUID-to-UInt128 conversion examples for Node and Web.
- Adds EPHEMERAL UUID column +
UInt128 DEFAULTexamples for Node and Web. - Adds the new example pair to the examples README coding table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
examples/node/coding/insert_uuid_into_uint128.ts |
Adds the Node example with node:assert round-trip checks. |
examples/web/coding/insert_uuid_into_uint128.ts |
Adds the Web example with an inline assertion helper. |
examples/README.md |
Links the new Node and Web examples in the coding section. |
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.
Inserting a UUID string into a
UInt128column viaJSONEachRowfails withCANNOT_PARSE_INPUT_ASSERTION_FAILEDbecause ClickHouse only converts UUID → UInt128 implicitly for theVALUESclause. The client correctly forwards the JSON unchanged; users need guidance on the supported patterns.Summary
Adds a new example (Node + Web) demonstrating two working approaches, with a round-trip assertion proving the server stores the value byte-for-byte.
examples/{node,web}/coding/insert_uuid_into_uint128.ts— two patterns:BigInt('0x' + uuid.replace(/-/g, '')).toString()passed as the UInt128 column value.UInt128 DEFAULT id_uuid+UUID EPHEMERALpaired withinsert({ columns: ['id_uuid', ...] }).SELECT(node:assert/strictin Node; tiny inlineassertEqualin Web, sincenode:assertisn't browser-compatible). Both patterns produce the same UInt128 decimal2126302229887840375125392584261985180.examples/README.md— new row in thecoding/table.Checklist
Release note
Added
examples/{node,web}/coding/insert_uuid_into_uint128.tsshowing how to insert a UUID into aUInt128column withJSONEachRow, either via client-side BigInt conversion or via anEPHEMERALUUID column with aUInt128 DEFAULTexpression, with a round-trip assertion verifying the stored value.