Skip to content

Commit 0067277

Browse files
Merge pull request #1839 from malonehedges/with-replicas-fix
fix: $with for withReplicas
2 parents 14e59f4 + 9aed6a3 commit 0067277

File tree

1 file changed

+4
-2
lines changed
  • drizzle-orm/src/pg-core

1 file changed

+4
-2
lines changed

drizzle-orm/src/pg-core/db.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ export const withReplicas = <
647647
const select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);
648648
const selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);
649649
const selectDistinctOn: Q['selectDistinctOn'] = (...args: [any]) => getReplica(replicas).selectDistinctOn(...args);
650-
const $with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);
650+
const _with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);
651+
const $with: Q['$with'] = (arg: any) => getReplica(replicas).$with(arg);
651652

652653
const update: Q['update'] = (...args: [any]) => primary.update(...args);
653654
const insert: Q['insert'] = (...args: [any]) => primary.insert(...args);
@@ -669,7 +670,8 @@ export const withReplicas = <
669670
select,
670671
selectDistinct,
671672
selectDistinctOn,
672-
with: $with,
673+
$with,
674+
with: _with,
673675
get query() {
674676
return getReplica(replicas).query;
675677
},

0 commit comments

Comments
 (0)