Closed MaxwellBo closed 2 years ago
Ah, so I used to have it set to url = env("DATABASE_URL")
but I was unable to dynamically set the URL depending on what region Gatho finds itself in. See pages/api/auth/[...nextauth].ts
for how I dynamically set the connection string.
I'm unsure if I can remove the url entirely from the schema and set it in the PrismaClient
constructor - that was a StackOverflow response suggesting leaving it empty.
Okay, I have discovered my problem. I think I assumed that the database URL would have its values interpolated by Prisma.
I had to manually set them s.t.
DATABASE_URL_AU="postgres://mb:@localhost:5432/matrix_events"
I'll keep this open as a TODO to childproof the setup documentation a bit more.
@MaxwellBo how does that PR look for improving docs on this issue?
I assume this is to do with the fact that
schema.prisma
definesyou could define
as per https://www.prisma.io/docs/reference/database-reference/connection-urls
but that simply recovers the uninterpolated DB URL
"postgres://{username}:{password}@{database_url:{port}/{database_name}"
.Any ideas?