Who uses #Prisma as their ORM?
What is your opinion about how they "join" the data when using "include" in your query?
They make two select statements and then join the data at their engine level instead of the database level.
@zaherg That’s why I hate ORMs
@skwee357 ORM, in general, are good, but this decision to not use the database is a bit strange.
They argue that they are aware of the issue and trying to fix it, as a friend pointed out in this discussion https://github.com/prisma/prisma/issues/5184
but still a strange decision from the first phase.
I am not trashing the project, they are good but somehow strange to me as an outsider
@zaherg ORMs are good for simple CRUD. Once you need something more complex, you find yourself fighting the ORM or resorting to raw queries anyway
@skwee357 depending on the ORM you use.
In many cases, while working with Laravel , I was able to do complex queries with Eloquent, which allowed me also to pass some RAW SQL statements.
I am not an expert in Prisma, but they have the ability to execute RAW SQL statements.
@skwee357 in eloquent, I can write something like
Employee()->select('salary', DB::raw('SUM(salary) OVER() sum_salary'))->get()
And it will work.
@zaherg Interesting. I wonder what query it generates
@skwee357 you can always get the query it generates by just appending "->toRawSql()" at the end of the query instead of `->get()`.
- This is how to add RAW SQL Statements https://laravel.com/docs/10.x/queries#raw-expressions
https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Query/Builder.php#L2642