3 ms·
Seems like it generates TS types, but doesn’t help with data access? i.e. not trying to compete with tools that generate full data access layers, like Prisma ht
by yashap 5y ago
Seems like it generates TS types, but doesn’t help with data access? i.e. not trying to compete with tools that generate full data access layers, like Prisma https://www.prisma.io/ https://www.prisma.io/ ?
If so, out of curiosity, what’s the use case for generating just the types? How are you actually getting data to/from the DB?
- yasserf 5y agoI think the comment I made above in in regards to our db crud updates might help answer that! But short answer is we just use node-postgres. If the get/update/delete/insert is a simple fields/table/where we use a helper function. If it's more complex we write custom SQL and use the following approach: database.query<DB.User & DB.Pet>(` SELECT * FROM "pet" LEFT JOIN user on pet.owner = user.id `)
- yashap 5y agoAh cool, makes sense :)