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
UNION ALL
using drizzle ortm, instead of running the as a raw query ?0 Replies