knex-schema-inspector icon indicating copy to clipboard operation
knex-schema-inspector copied to clipboard

Add support for listing unique constraints

Open Niikelion opened this issue 1 year ago • 2 comments

Hello there! I find working with unique constraints across multiple columns in knex pretty cumbersome due to inability to delete all of them them/check if they exist before redefining them. This leads to the need to remember what constraints have been defined before. This is why I propose adding uniqueConstraints method that will list all unique constraints. I'm more than willing to implement this feature for some dialects(oracledb is not working on my machine).

Niikelion avatar Nov 20 '23 16:11 Niikelion

Figured out how to make oracledb work. Now I probably can implement it for every dialect.

Niikelion avatar Nov 20 '23 19:11 Niikelion

I managed to implement this method for every dialect. If you decide to not include this feature in knex-schema-inspector full implementation will still be on my fork.

Niikelion avatar Nov 22 '23 00:11 Niikelion

Maybe this could be proposed to @directus/schema package ? (fork maintained by directus team) see https://github.com/directus/directus/tree/main/packages/schema

mdartic avatar Oct 01 '24 13:10 mdartic