Re:Prisma 2.0 – Type-safe and auto-generated database client
by kristiandupont on Tuesday June 09, 2020 @02:59PM
(#23469602)
I generate Typescript types from my database (https://github.com/kristiandupont/kanel) which gives me type safety on back- and frontend without relying on an ORM. I am curious about Prisma but I don't see any advantage to it from my quick skimming.
[ Parent
| on HN ]
Re:Prisma 2.0 – Type-safe and auto-generated database client
by dmoose on Tuesday June 09, 2020 @07:19PM
(#23472056)
I do the same using kanel. It's just enough to make the typings smooth without dictating anything else about how they are used. I prefer to write the queries directly in sql using pg-promise and then type the results of the query and the parameters of the query using the output of kanel. Any changes to the db result in generating new typings followed by running the tests to make sure nothing broke.
Re:Prisma 2.0 – Type-safe and auto-generated database client
by olso on Tuesday June 09, 2020 @04:15PM
(#23470387)
What do you use to write the queries? Some query builder?
Re:Prisma 2.0 – Type-safe and auto-generated database client
by kristiandupont on Wednesday June 10, 2020 @01:53AM
(#23474374)
I use a home made library on top of Knex that is not open source yet. I will extract it from the Submotion code and release it as well, but I am not sure when.