We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
drizzle-orm
0.30.10
drizzle-kit
0.21.4
Given a postgres schema and table name:
export const transactions = pgSchema("transactions"); export const TokenSwapInTransactions = transactions.table( "TokenSwap", { swapId: text("swapId").primaryKey().notNull(), transactionHash: text("transactionHash").notNull() } );
when performing this query
const lastTokenSwapQuery = db.query.TokenSwapInTransactions.findFirst({ orderBy: (tokenSwap, { desc }) => [desc(tokenSwap.logIndex)], });
causes the following run time error
PostgresError: relation "transactions.TokenSwap" does not exist
the issue is that the schema and table name are not being correctly escaped
Schema and Table names should be escaped in the format "{schema}"."{table}".
"{schema}"."{table}"
so in the example above "transactions.TokenSwap" should be "transactions"."TokenSwap"
"transactions.TokenSwap"
"transactions"."TokenSwap"
nodejs v20
The text was updated successfully, but these errors were encountered:
im so DUMB, I was pointing to the wrong db. This is not a bug.
Sorry, something went wrong.
No branches or pull requests
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.4
Describe the Bug
Given a postgres schema and table name:
when performing this query
causes the following run time error
PostgresError: relation "transactions.TokenSwap" does not exist
the issue is that the schema and table name are not being correctly escaped
Expected behavior
Schema and Table names should be escaped in the format
"{schema}"."{table}"
.so in the example above
"transactions.TokenSwap"
should be"transactions"."TokenSwap"
Environment & setup
nodejs v20
The text was updated successfully, but these errors were encountered: