Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: $with for withReplicas #1839

Open
wants to merge 3 commits into
base: beta
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions drizzle-orm/src/pg-core/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,8 @@ export const withReplicas = <
const select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);
const selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);
const selectDistinctOn: Q['selectDistinctOn'] = (...args: [any]) => getReplica(replicas).selectDistinctOn(...args);
const $with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);
const _with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);
const $with: Q['$with'] = (arg: any) => getReplica(replicas).$with(arg);

const update: Q['update'] = (...args: [any]) => primary.update(...args);
const insert: Q['insert'] = (...args: [any]) => primary.insert(...args);
Expand All @@ -638,7 +639,8 @@ export const withReplicas = <
select,
selectDistinct,
selectDistinctOn,
with: $with,
$with,
with: _with,
get query() {
return getReplica(replicas).query;
},
Expand Down