Skip to content

212#213

Merged
RAprogramm merged 1 commit into
mainfrom
212
Jul 5, 2026
Merged

212#213
RAprogramm merged 1 commit into
mainfrom
212

Conversation

@RAprogramm

Copy link
Copy Markdown
Owner

Closes #212.

Adds a ci flag to #[column(...)] for case-insensitively unique text columns (usernames, emails, handles):

  • find_by_{field} / exists_by_{field} compare via LOWER(col) = LOWER($1)
  • Option<T> fields unwrap to T in the lookup signature — a NULL column never matches a probe
  • With migrations, unique + ci emits a functional CREATE UNIQUE INDEX {table}_{column}_lower_key ON {table} (LOWER({column})) instead of an inline UNIQUE constraint
  • With typed_constraints, violations of that index resolve to the field like any other unique constraint

Wiki (Attributes-en) documents the flag.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rates/entity-derive-impl/src/entity/parse/field.rs 80.00% 2 Missing ⚠️
crates/entity-derive-impl/src/entity/repository.rs 66.66% 1 Missing ⚠️
...derive-impl/src/entity/sql/postgres/constraints.rs 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RAprogramm RAprogramm merged commit d087911 into main Jul 5, 2026
17 checks passed
@RAprogramm RAprogramm deleted the 212 branch July 5, 2026 03:22
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.

feat(sql): case-insensitive unique columns via #[column(ci)]

1 participant