Replies: 2 comments 5 replies
-
Wondering which route you took @severi, care to share you experience? |
Beta Was this translation helpful? Give feedback.
-
In case it help anyone, I have been doing a type assertion style conversion which has been working quiet well. It doesn't convert zod to electrodb attributes/schema, which I don't think would be possible beyond super simple models, but it does give type completion, compilation errors, and intellisense to move pretty quick. Has decent coverage of Zod and ElectroDB types, but missing MapAttributes as I don't use them and just use any.
|
Beta Was this translation helpful? Give feedback.
-
Im trying to find a way to integrate Electrodb to our application. Currently we use zod for handling typing/data validation. Our data models can be rather complex and we for example quite extensively use discriminated unions.
If we want to take Electrodb into use we would need somewhat duplicate our model definitions (zod + electrodb entity attributes). Does anyone else have experience with this, and are there any ways to reduce the amount of copy paste needed.
Would there for example be some simple way to only define some basic set of attributes for electrodb entities (for example those used for partition keys, sortkeys, etc, but also allow "any other elements" to be stored to the object (currently they are removed automatically).
Beta Was this translation helpful? Give feedback.
All reactions