You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that the bug I'm about to report hasn't been filed before.
What version of drizzle-orm are you using?
0.33.0
What version of drizzle-kit are you using?
0.22.0
Other packages
No response
Describe the Bug
I got error when try to use WITH clause in my Sveltekit app.
const baseStatusQuery = db.$with('base_stats').as(
db
.select({
discipline: task.discipline,
total: sql<number>`COUNT(*)`,
done_total: sql<number>`SUM(CASE WHEN status = ${TaskStatus.done} THEN 1 ELSE 0 END)`,
not_started_total: sql<number>`SUM(CASE WHEN status = ${TaskStatus.notStarted} THEN 1 ELSE 0 END)`,
outstanding_total: sql<number>`SUM(CASE WHEN status = ${TaskStatus.outstanding} THEN 1 ELSE 0 END)`,
on_progress_total: sql<number>`SUM(CASE WHEN status = ${TaskStatus.onProgress} THEN 1 ELSE 0 END)`
})
.from(task)
.groupBy(task.discipline)
);
The error:
TypeError: __vite_ssr_import_1__.db.$with is not a function
at GET (/Users/xxx/projects/yyy/web/src/routes/api/v1/disciplines/summary/+server.ts:46:29)
at Module.render_endpoint (/Users/xxx/projects/yyy/web/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:43:24)
at resolve (/Users/xxx/projects/yyy/web/node_modules/@sveltejs/kit/src/runtime/server/respond.js:455:23)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Module.respond (/Users/xxx/projects/yyy/web/node_modules/@sveltejs/kit/src/runtime/server/respond.js:331:20)
at async fetch (/Users/xxx/projects/yyy/web/node_modules/@sveltejs/kit/src/runtime/server/fetch.js:138:22)
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.33.0
What version of
drizzle-kit
are you using?0.22.0
Other packages
No response
Describe the Bug
I got error when try to use WITH clause in my Sveltekit app.
The error:
My stack:
The text was updated successfully, but these errors were encountered: