Skip to content

Added support for Vec<UUID> // Array(UUID) #424

Open
JaminMartin wants to merge 2 commits into
ClickHouse:mainfrom
JaminMartin:feature/vec_uuid
Open

Added support for Vec<UUID> // Array(UUID) #424
JaminMartin wants to merge 2 commits into
ClickHouse:mainfrom
JaminMartin:feature/vec_uuid

Conversation

@JaminMartin
Copy link
Copy Markdown

Summary

Added serde::uuid_vec for serializing/deserializing Vec<uuid::Uuid> to/from Array(UUID), including an option submodule for Option<Vec> <--> Nullable(Array(UUID)). I have also updated the README with a usage example in the UUID section.

Reason

I found the need to have an array of UUID's in my data structure and clickhouse-rs does not currently support it. I tested my table against the python-sdk and it worked fine, so I thought I would implement it for clickhouse-rs as it is my primary clickhouse sdk.

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided so that we can include it in CHANGELOG later
  • For significant changes, documentation in README and https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 15, 2026

CLA assistant check
All committers have signed the CLA.

Comment thread src/serde.rs
use serde::ser::SerializeSeq;
use std::fmt;

pub mod option {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you chose to add this, could you please add test coverage as well? I think it can just go in the existing test.

Comment thread README.md
}
```
</details>
* `Array(UUID)` maps to/from `Vec<uuid::Uuid>` by using `serde::uuid_vec`. Requires the `uuid` feature.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's debatable where this should go. We have a bullet point later on covering arrays, we should at least mention this as a special case there.

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.

3 participants