4 Replies
* What is the point of defining return schemas for convex functions? It seems not to have a typescript benefit and even sometimes causes unnecessary errors (eg due to extra fields returned)
* Is there a way to implement something analogous to a "foreign key constraint" or cascade on delete? It's awkward to have a stored id that no longer points to anything
* It would be nice to have the option to delete data from the dev database using the cli (or maybe even the mcp server), often in early development it's nice to change the schema in backwards incompatible ways
* Weird use case — what if I have a query that returns hundreds of documents, and the documents might change one at a time rapidly. Is there a way for the client to receive more granular updates than the whole list of documents after every change?
Follow up on this: if I have a lot of contention on adding documents in a possibly conflicting way rapidly, is there a way to guarantee I won't get OCC errors, such as a way to explicitly lock just for this operation?
there's a one-liner to clear the dev db using the terminal: https://discord.com/channels/1019350475847499849/1019350478817079338/1382389423513145494
you can use
convex-helpers
triggers: see https://stack.convex.dev/triggers and https://stack.convex.dev/triggers#cascade-deletesDatabase Triggers
Triggers automatically run code whenever data in a table changes. A library in the convex-helpers npm package allows you to attach trigger functions t...
Oh these both are awesome, thank you!