Skip to content

Conversation

@i3abghany
Copy link
Contributor

This implements the UNIQUE column constraint. It's an attempt to revive this cool database implementation. This does a simple O(n) search for uniqueness; we may need to use a BTree index for better performance, but this is good as a first step.

Parse UNIQUE keyword in CREATE TABLE column definitions, supporting
both inline UNIQUE and named CONSTRAINT UNIQUE syntax. Updates the
ColumnDefinition AST node to track unique constraint information.
Add unique constraint validation to INSERT and UPDATE operations.
Column definitions now track unique constraints in metadata, and
the database validates uniqueness before modifying data.
Mahmoud Abumandour is my legal name. I don't know why I was using
"Mandour" for a last name in 2021. Also update copyright year to 2025
@github-actions github-actions bot added 👀 pr-needs-review PR needs review from a maintainer or community member labels Sep 28, 2025
@gmta
Copy link
Member

gmta commented Oct 5, 2025

Hm, shouldn't we start off by having support for unique table constraints though? The next step would be to have unique constraints on two or more columns, and then you'd have to rework this as a single-column table constraint anyway.

@nico nico added ⏳ pr-waiting-for-author PR is blocked by feedback / code changes from the author and removed 👀 pr-needs-review PR needs review from a maintainer or community member labels Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⏳ pr-waiting-for-author PR is blocked by feedback / code changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants