electric
electric copied to clipboard
Document how to create and use types
It's really handy to have types for e.g. useShape. There's a variety of ways you can get your db's types and we should document it.
- common ORMs like Prisma/Drizzle generate types
- there are tools that will generate types directly from PG — we should document one.
There's also some gotchas with at least Drizzle where by default it generates camelCase types despite the db using snake_case — so documenting the workarounds for that.
Nice -- a Types guide or part of the Typescript client docs?
Hmm good question — it could be separate as it's a pretty specific guide — also it's needed with tanstack/optimistic so it isn't directly tied to the typescript client. But a subsection of the typescript guide makes sense.