directus-labs / extensions

Experimental and community-maintained extensions for Directus
MIT License
35 stars 8 forks source link

Calculated Fields: Persist Values in Database #73

Open arladmin opened 1 week ago

arladmin commented 1 week ago

Extension

Something else

Describe the Improvement

Re extension: Calculated Fields Bundle

While it's great to see the long-due Calculated Fields functionality being implemented (https://github.com/directus/directus/discussions/3079), in some capacity, it's still missing the (pretty crucial) aspect of actually persisting the calculated values in the db, which is what the original FR was all about, at least from my perspective.

And as the FR has surprisingly already been closed, i'm creating this issue to continue the FR here.

phazonoverload commented 6 days ago

Alias fields don't return values in API requests, however as the field configuration exists in the database (including the formula), and we already know how to parse and evaluate it, I'm wondering how we can return the value via API.

I don't think persisting in the database makes sense though as it requires keeping the values in sync.

phazonoverload commented 6 days ago

Also just want to emphasise that the feature request originally only spoke about the alias interface which exists in the extension, but the community discussion suggested an expansion in scope. :)