If this is an example project for the public, it would be better to use something like Drizzle or some other tool to do the SQL. Personally, I feel that using effect/sql directly defeats a lot of the purpose of Effect which is to keep everything typed correctly, including errors. Just an opinion, nice video :D
Using effect/sql and considering the database like any external data source your app can access doing encoding + decoding with schemas is 100x safer and more type safe than using a "type-safe" query builder and trusting the database is in any particular shape. We will at some point work on a query builder on top of schema which does encoding/decoding under the hood but we don't have a huge priority on it, most of us actually prefer writing plain SQL
@@michaelarnaldi6680 An Effect Query Builder would be absolutely awesome! Totally get not wanting to rely on the drizzle shape alone-we do the same and run our drizzle responses through a validator to avoid headaches. I mentioned it because I’ve lost count of how many times I’ve typed something like "user_id" when it should’ve been "userId" or something else entirely. Might just be a skill issue on my part, though!
Relying entirely on effect feels limiting in some cases. It would be much more helpful to see an express/adonis-based project gradually transitioning to effect step by step.
It's a choice, one could decide to incrementally start adopting effect (and just for some parts of the code where it makes more sense), or decide to start an entire new project using mainly effect (like we do on the streams); both are valid options and mainly depends on your scope, situation, and use case :)
@@mattiamanzati_ I mean, seeing examples where the mindset isn’t entirely shaped around effect would be far more useful for me. Note: I edited the main comment to make it clearer.
Is the code anywhere online to be found? I would like to take a closer look at that.
Same, would love to take a look at it interactively in my own editor
If this is an example project for the public, it would be better to use something like Drizzle or some other tool to do the SQL. Personally, I feel that using effect/sql directly defeats a lot of the purpose of Effect which is to keep everything typed correctly, including errors.
Just an opinion, nice video :D
Using effect/sql and considering the database like any external data source your app can access doing encoding + decoding with schemas is 100x safer and more type safe than using a "type-safe" query builder and trusting the database is in any particular shape. We will at some point work on a query builder on top of schema which does encoding/decoding under the hood but we don't have a huge priority on it, most of us actually prefer writing plain SQL
@@michaelarnaldi6680 An Effect Query Builder would be absolutely awesome! Totally get not wanting to rely on the drizzle shape alone-we do the same and run our drizzle responses through a validator to avoid headaches. I mentioned it because I’ve lost count of how many times I’ve typed something like "user_id" when it should’ve been "userId" or something else entirely. Might just be a skill issue on my part, though!
Relying entirely on effect feels limiting in some cases. It would be much more helpful to see an express/adonis-based project gradually transitioning to effect step by step.
It's a choice, one could decide to incrementally start adopting effect (and just for some parts of the code where it makes more sense), or decide to start an entire new project using mainly effect (like we do on the streams); both are valid options and mainly depends on your scope, situation, and use case :)
@@mattiamanzati_ I mean, seeing examples where the mindset isn’t entirely shaped around effect would be far more useful for me.
Note: I edited the main comment to make it clearer.