Select with relation
Is there a way to get relations when using
db.select().from(table)
I can't get the db.query.table.findMany
to work, so if someone could help me get that setup that would be fine too10 Replies
I can help you with setting up relational quries, what didn't work for you?
Basically whenever I try following the docs I get an error like postgreserror: unrecognized configuration parameter "schema"
This is what I had setup
And my schema for question looks like this
What version of drizzle orm are you using? 0.26.0?
yes
is it possible that I did not properly push my schemas?
do you have anything except of table and relations object in your schema file?
I got multiple tables but nothing else
oh, it's a bit tough, can't repro locally
will dig into it more
I might have fixed it...
Ill update in a bit
@Andrew Sherman I seem to have had quite a few issues with an outdated config for drizzle now it's been cleared up but one question tho, what is the correct order of drizzle-kit commands and how can I make it automatically push schemas to the db?
Hey there, I just setup drizzle and got the same error can you point me to a direction on how you fixed it ?
I even tried with a schema of a single table and got the same issue trying to run
So I pushed the schema (this worked correclty) but when trying to run a query in the code got the same issue
(I checked that everything was defined correcly (schema path, db url))
Ok stypid mistake on my part I just reused the url of the database from Prisma and they use a ?schema=public instead of ?search_path=public in the Url
so you're saying drizzle uses
?search_path=public
?
YES THATS WHAT YOU MEAN
THANK YOU DUDE
HOLY, I SPENT FUCKING HOURS TRYING TO FIX