Support for virtual fields from config #6270
r1tsuu
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There's a good blog post about Virtual Fields https://payloadcms.com/blog/learn-how-virtual-fields-can-help-solve-common-cms-challenges
And yes, it's true, they are great. But if you are using SQL database, the schema for this field is still created, because there's no way to determine whatever field is "virtual" or not.
My proposal would be to add a field option like:
isVirtual: true
ordb: { store: false }
so then in our adapter we can skip the schema for this field, but instead we should validate forafterRead
hook existance and automatically delete this field beforecreate
/update
operation.Beta Was this translation helpful? Give feedback.
All reactions