Open codemaverick80 opened 2 months ago
Seeing the same on drizzle-orm 0.33.0.
Looking at the PSQL logs the table name is replaced with $1. E.g. select from $1 where "test_view"."user_id" = $2
. Also note that my selection seems to have disappeared.
I spent 20 minutes on it. Placing
console.log('PG_VIEW_BASE', is(table, PgViewBase));
in the beginning of buildSelectQuery
in dialect.js
shows that as long as the query works (first load for me in Next.js), it returns true. On a reload it starts showing false and fails.
It only manifests for me in dev-mode. In release mode it runs fine. But having to restart in continuously in dev really hampers the flow...
What version of
drizzle-orm
are you using?0.32.1
What version of
drizzle-kit
are you using?0.23.1
Describe the Bug
I have an existing view in my PostgreSQL database and its very simple view. I am trying to query this view from my Nextjs app with drizzle orm but I am getting error.
Here is how i am declaring and using it.
schema.ts
action.ts
when i run the app i am getting
I also checked Postgres log and this is what i see
I am able to query view in PgAdmin without any issue.
Expected behavior
should return data from postgres view
Environment & setup
OS: windows 10 64 bit
Node Version: v20.11.1
NextJs version: 14.2.5