index arrays
Hello, does anyone know if there's a plan to support indexed arrays in the future? I've seen a few work arounds but hoping they don't have to be permeant.
2 Replies
i don't believe so. do you have an example database that does support this (i'm pretty sure postgres and mysql don't index array values either, for example). the standard solution, in convex as in other relational databases, is to denormalize the array values as edges in a relational/graph data model. Even the databases that do support it (like mongodb), do this under-the-hood; it's just a matter of syntax.
I expect you've seen these already, but to get nicer syntax in Convex you can use relationship helpers https://stack.convex.dev/functional-relationships-helpers or Ents https://labs.convex.dev/convex-ents .
Database Relationship Helpers
Traverse database relationships in a readable, predictable, and debuggable way. Support for one-to-one, one-to-many, and many-to-many via utility func...
Convex Ents - Convex Ents
Relations, default values, unique fields and more for Convex
Thanks for responding and sharing the link, good point on other databases not supporting it. I'll take a more thorough look now through the links