oscklm
oscklm14mo ago

Advice/feedback on big schema for our video table

Hello, So after using convex for a while now, and our platform growing in size and complexity. I would love to ask for feedback & potential advice on how to improve our way of defining our schema. I'm mostly curious to learn whether we are doing anything that is specifically advised against, so that i can fix this while we are still in development. Below i have attached a gist which is our videos table, and how its currently defined. This is by far the most complex piece of data in our platform at the moment, and i have tried to set it up after the best practices that i've gathered from all the great advice received from stack posts and the team in general, including my own experience from using convex for a little while now. Anyway, feel free to leave any thoughts in this thread. I'd love to discuss this, so that i can improve and others can find this and also use it as example if they are too sitting with schema definitions that are getting big in size. Link to gist: https://gist.github.com/oscdot/b1ff1cae4d7442f2d11c78ac5bad7c8a
3 Replies
Varun Singh
Varun Singh14mo ago
Is there any particular reason you said
v.object({
...challengeActivityFields,
}),
v.object({
...challengeActivityFields,
}),
instead of
v.object(challengeActivityFields)
v.object(challengeActivityFields)
No description
Varun Singh
Varun Singh14mo ago
This is a small thing I found in taking a quick glance, but it'll make the code a bit cleaner
oscklm
oscklmOP14mo ago
Yes, that's because of what Ian suggested previously, it's actually really smart -> https://discord.com/channels/1019350475847499849/1186276934796197940/1186358347675475998

Did you find this page helpful?