Skip to content

Conversation

@raffomania
Copy link
Contributor

PR Info

  • Related to Support storing Uuids as SQLite TEXT columns #2717, but does not close it
  • I haven't tested this with databases other than SQLite
  • I'd like to add a test asserting that the database schema actually uses the TEXT type but haven't found out how
  • First time contributing, please let me know if I missed anything!

New Features

  • Add TextUuid wrapper type for storing Uuids as a TEXT column

/// - Allows for queries like `WHERE id IN (<uuid>, <uuid>, ...)` which are
/// impossible to write with `BLOB` values
#[derive(Clone, Debug, PartialEq, Eq, Copy)]
pub struct TextUuid(pub uuid::Uuid);
Copy link
Member

Choose a reason for hiding this comment

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

UuidText or TextUuid? @tyt2y3 @Expurple

Copy link
Member

Choose a reason for hiding this comment

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

I prefer TextUuid (AdjectiveNoun)

Copy link
Member

@Expurple Expurple left a comment

Choose a reason for hiding this comment

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

This seems to only cover the entity-first approach where you define entities by hand and can set a custom column type.

I assume, you don't use the migration-first approach with autogenerated entities? This use case is currently unsupported by the PR.

This isn't necessarily a problem. We can postpone this feature (a new sea-orm-cli flag, a-la --uuid-type=text) until someone actually needs it.

If you want to contribute that too, you can do that in a separate PR, dependent on this one

@tyt2y3
Copy link
Member

tyt2y3 commented Jan 16, 2026

I would probably have written it as UuidText haha, but doesn't matter.
we can merge this in first, I will try to add more support around it

@tyt2y3 tyt2y3 merged commit 04fa9fa into SeaQL:master Jan 16, 2026
38 checks passed
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.

4 participants