News for hackers. Stuff that matters.
Re:SvelteKit 1.0 by jmull on Wednesday December 14, 2022 @01:21PM (#33987492)
Personally, I'd remove tRPC on down (and choose a database).

It's nice there's type-safety between layers, but that's a bunch of layers that you don't even need. (A layer that doesn't exist takes is 100% type-safe and takes 0 hours to develop and maintain).

Re:SvelteKit 1.0 by deepsun on Wednesday December 14, 2022 @02:10PM (#33988477)
In Mongo you don't need to manage a schema, because it's SCHEMALESS! /s
Re:SvelteKit 1.0 by shepherdjerred on Wednesday December 14, 2022 @02:28PM (#33988803)
> A layer that doesn't exist takes is 100% type-safe

How are you ensuring your database accesses are type-safe in this case?

Re:SvelteKit 1.0 by jmull on Wednesday December 14, 2022 @05:20PM (#33991468)
That's fair... I do typically have a layer that sits at the level of an ORM, whose purpose is to reduce boilerplate and handle/verify types.

So I can't really claim I have nothing at the ORM level... However...

In my experience, when you pull in an off-the-shelf ORM and an off-the-shelf RPC framework you end up building app-level wrappers anyway to deal with the complexity and impedance mismatch between what you want your app to use for data access code and what layer provides.

So I think you might as well put your app-level database wrapper as directly around the database as you can manage (that probably means using the common, unopinionated client for your db... e.g., node-postgres for server-side javascript and postgres, or whatever the equivalent is for your backend/database).