Feng Yu
DTDrizzle Team
•Created by Feng Yu on 4/2/2025 in #help
Magic sql does not add table name in query?
Here's the sample:
The generated SQL is:
You can see the
${users.logo}
not convert to "users"."logo"
, ${users.id}
not convert to "users"."id"
, which will cause some queries not get the correct result.
How could I solve it? I really don't like the pure SQL like SELECT json_build_object('logo', u.logo) FROM users u
because this lack of IDE support (variables trace).
Thanks.1 replies
DTDrizzle Team
•Created by Feng Yu on 3/26/2025 in #help
Is there any easy way to query both total count and pagination result?
The official doc shows a simple pagination query with dynamic query:
But how to also return the total count ?
I know Grails GORM has a
PagedResultList
wrapper to do so : https://docs.grails.org/latest/ref/Domain%20Classes/createCriteria.html
When pass pagination query params it will query database twice, one is total count query, and another is the pagination result, and wrapper them into a PagedResultList
class.
Is there any way to do this in Drizzle ORM?
Like:
Thanks.2 replies