Prem
Prem
Explore posts from servers
NNuxt
Created by Prem on 8/9/2024 in #❓・help
ESLint not recognizing TypeScript syntax
No description
6 replies
NNuxt
Created by Prem on 6/20/2024 in #❓・help
`$fetch` error handling.
No description
3 replies
DTDrizzle Team
Created by Prem on 6/19/2024 in #help
How to achieve the same in drizzle ORM ?
SELECT 'TOTAL_COURSES' AS name , COUNT(id) FROM course WHERE deleted_at IS NULL
UNION ALL
SELECT 'PUBLISHED_COURSES' AS name, COUNT(id) FROM course WHERE is_published = true AND deleted_at IS NULL
UNION ALL
SELECT 'COURSE_LEAD' AS name, COUNT(id) FROM lead WHERE type = 'COURSE' AND deleted_at IS NULL
UNION ALL
SELECT 'COURSE_LEAD_PENDING' AS name, COUNT(id) FROM lead WHERE type = 'COURSE' AND deleted_at IS NULL
UNION ALL
SELECT 'TOTAL_JOBS' AS name, count(id) FROM job WHERE deleted_at IS NULL
UNION ALL
SELECT 'PUBLISHED_JOBS' as name, count(id) FROM job WHERE is_published = true AND deleted_at IS NULL
UNION ALL
SELECT 'JOB_LEAD' AS name, COUNT(id) FROM lead WHERE type = 'JOB' AND deleted_at IS NULL
UNION ALL
SELECT 'JOB_LEAD_PENDING' AS name, COUNT(id) FROM lead WHERE type = 'JOB' AND deleted_at IS NULL
SELECT 'TOTAL_COURSES' AS name , COUNT(id) FROM course WHERE deleted_at IS NULL
UNION ALL
SELECT 'PUBLISHED_COURSES' AS name, COUNT(id) FROM course WHERE is_published = true AND deleted_at IS NULL
UNION ALL
SELECT 'COURSE_LEAD' AS name, COUNT(id) FROM lead WHERE type = 'COURSE' AND deleted_at IS NULL
UNION ALL
SELECT 'COURSE_LEAD_PENDING' AS name, COUNT(id) FROM lead WHERE type = 'COURSE' AND deleted_at IS NULL
UNION ALL
SELECT 'TOTAL_JOBS' AS name, count(id) FROM job WHERE deleted_at IS NULL
UNION ALL
SELECT 'PUBLISHED_JOBS' as name, count(id) FROM job WHERE is_published = true AND deleted_at IS NULL
UNION ALL
SELECT 'JOB_LEAD' AS name, COUNT(id) FROM lead WHERE type = 'JOB' AND deleted_at IS NULL
UNION ALL
SELECT 'JOB_LEAD_PENDING' AS name, COUNT(id) FROM lead WHERE type = 'JOB' AND deleted_at IS NULL
can someone tell me how i can achieve such, UNION ALL using drizzle ortm, instead of running the as a raw query ?
1 replies