Query issue - Syntax error at or near "$1"
Hello, I currently got this error recently:
PostgresError: syntax error at or near "$1"
This is the query i am trying to make. Note that this worked fine very recently.
If i use "toSQL()" in order to see what is being queried. I get the following:
I was expecting it to do 'select * from $1 order by $2 desc limit $3'
Using 0.26.5
Trying to upgrade to 0:27 gives a bunch of type errors for some reason:
Like:
'[isDrizzleTable]' is missing in type 'pgTable<{name: "enhet"; schema: "brreg"; columns: { ... }; ...}>'
Find that type error strange since i do not expect isDrizzleTable to be required in a schema i define? Anyone familiar with any of this, or what might be occuring here?![](https://cdn.answeroverflow.com/1127874228436349049/image.png)
1 Reply
Currently retracing back to older versions of the repo / dependencies where it all worked.
Update: Turns out to be a user issue like always.
I happen to work in two different workspaces.
Database workspace:
Where i handle migrations and define my schemas
Provider workspace:
Where use the schemas in order to do operations towards the db.
I happened to install drizzle-orm as dependency on both workspaces. But i should only use one instance of the drizzle-orm dependency.
So when i foolishly saw the dependency was missing in the provider workspace and installed it. Breaking everything 😉
Maybe my mistakes is helpful to someone else in the future.