-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
[BUG]: $with is undefined on withReplicas
#1834
Comments
resolved by #1839 |
@malonehedges thanks a lot! Will merge your PR |
@AndriiSherman can you merge this? We patch-packages, but would be nice to resolve this upstream |
@malonehedges thanks for raising this, I encountered this issue and you saved me a whole bunch of debugging time <3 |
Since the solution isn't merged yet, this is the hacky solution we're using: export db = withReplicas(...);
// @ts-ignore
db.$with = db.$primary.$with; |
@Yuval-Peled, out of curiosity, how do you deal with the fact that |
Locally I configured the "read replica" connection string to be the same as
the primary DB in our .env configuration files.
…On Fri, Aug 23, 2024 at 9:20 AM Jan Vorwerk ***@***.***> wrote:
Since the solution isn't merged yet, this is the hacky solution we're
using:
export db = withReplicas(...);// @ts-ignoredb.$with = db.$primary.$with;
@Yuval-Peled <https://github.com/Yuval-Peled>, out of curiosity, how do
you deal with the fact that $primary is only defined when you enable read
replicas <#2115>?
Does it mean you always use read replicas? Even in dev?
—
Reply to this email directly, view it on GitHub
<#1834 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHNYDWAGVXZNYCMEJRW7Y43ZS3ID5AVCNFSM6AAAAABCLRLIOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGM3TEOBTGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks,
Yuval Peled
|
This patch fixed our use of replicas – without it, you cannot use replicas with drizzle. |
Fixed in |
What version of
drizzle-orm
are you using?0.29.3
What version of
drizzle-kit
are you using?0.20.10
Describe the Bug
Expected behavior
$with should work, or the type should be different.
I'm happy to specify if i'm using the primary or a read replica, or construct the query another way if possible.
As-is, the types suggest this works when it doesn't.
Environment & setup
I am using node-postgres as my database.
The text was updated successfully, but these errors were encountered: