Exposed icon indicating copy to clipboard operation
Exposed copied to clipboard

Allow index class to be extended

Open rockwotj opened this issue 4 years ago • 3 comments

Right now indexes are a data class and not able to be modified. The nice thing about columns is that I can add custom column types if I like as there is an interface. However if I want to extend this library to have custom indexes (for example https://github.com/JetBrains/Exposed/issues/585 or to be able to change to a hash index) I cannot do that.

rockwotj avatar Apr 24 '20 14:04 rockwotj

Is there currently any way to create an index with a function? For example an index in PostgreSQL applied to lower function on the column. E.g. create index lower_column on table (lower(column::text));

KubqoA avatar Dec 12 '20 21:12 KubqoA

As far as I know, there is not with Exposed. Additionally you can not extend exposed to do this either.

rockwotj avatar Dec 13 '20 01:12 rockwotj

It seems that it is still not possible to apply a function when creating an index, as suggested above. Is there any plan on supporting this feature?

vincent-cognite avatar Mar 09 '22 11:03 vincent-cognite

@rockwotj There have been 3 recently merged PRs that support: partial index in PostgreSQL and other databases, as well as functional index, which will be available in the upcoming version. And providing index type has been supported since version 0.26.1.

If an open/modifiable Index is a feature you still believe is worth adding, please consider opening a feature request on YouTrack, with a specific use case example so we can look further into it.

bog-walk avatar Jul 12 '23 09:07 bog-walk