Skip to content

Commit

Permalink
Merge pull request #1839 from malonehedges/with-replicas-fix
Browse files Browse the repository at this point in the history
fix: $with for withReplicas
  • Loading branch information
AndriiSherman authored Dec 3, 2024
2 parents 14e59f4 + 9aed6a3 commit 0067277
Showing 1 changed file with 4 additions and 2 deletions.
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 @@ -647,7 +647,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 @@ -669,7 +670,8 @@ export const withReplicas = <
select,
selectDistinct,
selectDistinctOn,
with: $with,
$with,
with: _with,
get query() {
return getReplica(replicas).query;
},
Expand Down

0 comments on commit 0067277

Please sign in to comment.