Open Liooo opened 1 year ago
Atlas has index expression support which does just that: https://atlasgo.io/atlas-schema/sql-resources#index-expressions .
It would be really cool to have this available in Ent too (when using Atlas). Main use case on my end is to have more control over JSONB indexing (for example only indexing a specific field inside an object).
Atlas has index expression support which does just that: https://atlasgo.io/atlas-schema/sql-resources#index-expressions .
It would be really cool to have this available in Ent too (when using Atlas). Main use case on my end is to have more control over JSONB indexing (for example only indexing a specific field inside an object).
how to do it? I don't understand, can atlas be integrated with ent?
use ent to generate the sql file and use atlas to migrate it afterwards?
Atlas has index expression support which does just that: https://atlasgo.io/atlas-schema/sql-resources#index-expressions . It would be really cool to have this available in Ent too (when using Atlas). Main use case on my end is to have more control over JSONB indexing (for example only indexing a specific field inside an object).
how to do it? I don't understand, can atlas be integrated with ent?
use ent to generate the sql file and use atlas to migrate it afterwards?
The issue with this is if you modify the index in the generated SQL file and generate again, it will drop the index.
Just ran into this. The docs here mention that there are no APIs for defining a functional index: https://entgo.io/docs/schema-indexes#functional-indexes
cc @a8m 👋🏼 is there a reason for the above? There are APIs for almost everything else :)
Summary 💡
Would be great if ent supported functional index creation like:
https://www.postgresql.org/docs/7.3/indexes-functional.html
Motivation 🔦
To have an index without adding a new column.