Skip to content

Conversation

@ericsodev
Copy link

@ericsodev ericsodev commented Jul 20, 2025

Closes #1110.

This PR allows unique constraints to accept any expression or expression factory alongside columns. This applies to create and alter table builders.

For example:

.addUniqueConstraint("some_name", ["regular_col", sql`abs(age)`])

The functionality tests currently tests for MySQL.

@vercel
Copy link

vercel bot commented Jul 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2025 10:51pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 20, 2025

kysely_koa_example

npm i https://pkg.pr.new/kysely-org/kysely@1518

commit: 3208fe1

@ericsodev ericsodev marked this pull request as ready for review July 20, 2025 20:22
@ericsodev ericsodev requested a review from igalklebanov July 20, 2025 20:22
Copy link
Member

@igalklebanov igalklebanov left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@igalklebanov igalklebanov added enhancement New feature or request mysql Related to MySQL labels Jul 26, 2025
@igalklebanov igalklebanov added postgres Related to PostgreSQL api Related to library's API labels Jul 26, 2025
@igalklebanov igalklebanov changed the base branch from master to next July 26, 2025 20:55
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
@igalklebanov igalklebanov force-pushed the constraint-sql-expressions branch from a21e061 to 3208fe1 Compare July 26, 2025 22:50
@igalklebanov igalklebanov added deprecation Something is/should be deprecated internal labels Jul 26, 2025
@igalklebanov igalklebanov merged commit d87ac8e into kysely-org:next Jul 26, 2025
28 checks passed
igalklebanov added a commit that referenced this pull request Jul 29, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Aug 9, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Sep 14, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Sep 20, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
@igalklebanov igalklebanov mentioned this pull request Sep 20, 2025
igalklebanov added a commit that referenced this pull request Sep 28, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Sep 29, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Oct 9, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Oct 9, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
igalklebanov added a commit that referenced this pull request Oct 11, 2025
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to library's API deprecation Something is/should be deprecated enhancement New feature or request internal mysql Related to MySQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support expressions in constraints

2 participants