Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

abalabahaha
Copy link
Contributor

@abalabahaha abalabahaha commented Aug 31, 2022

Adds MSSQL, PostgreSQL, and SQLite support for partial unique indexes, heavily based on #4768.

The Postgres driver defaults to creating a unique constraint instead of an index, so Postgres support for useConstraint was added, defaulting to true without predicate and false with predicate. The alternative would be to always default to useConstraint: true, but then predicate would error by default unless useConstraint: false is explicitly specified. Dunno which is better.

Docs: knex/documentation#449

Fixes #4870

@coveralls
Copy link

coveralls commented Aug 31, 2022

Coverage Status

Coverage increased (+0.05%) to 92.323% when pulling 60da980 on abalabahaha:feat/partial-unique into 57692d3 on knex:master.

@kibertoad
Copy link
Collaborator

@abalabahaha unit tests are failing

@abalabahaha
Copy link
Contributor Author

@kibertoad sorry about that, I must have missed those since random tests were timing out on my computer. I fixed the failed tests

@kibertoad kibertoad merged commit 864530c into knex:master Sep 1, 2022
@enchorb
Copy link

enchorb commented Dec 17, 2022

Any idea when this will be released?

@kibertoad
Copy link
Collaborator

This was released in 2.4.0, sorry for the delay

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.

Feature request: partial index inside unique method

4 participants