10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
As a developer, I want to bulk migrate some tables within rake migrations, running a similar query for multiple tables. That's what I do:
change(async (db, up) => { for (const t of ["foo", "bar", "baz"]) { if (up) { await db.query`update ${db.ref(t)} set tx_data = jsonb_build_object('id', tx_id) where tx_id is not null` } else { await db.query`update ${db.ref(t)} set tx_id = tx_data->>'id' where tx_data is not null` } } }),
Expected: db.ref(t) inserts table name to raw SQL.
db.ref(t)
Result:
[unhandledRejection] Cannot read properties of undefined (reading 'operators') at new RefExpression (node_modules/.pnpm/pqb@0.51.0/node_modules/pqb/src/queryMethods/expressions.ts:63:31) at Function.ref (node_modules/.pnpm/pqb@0.51.0/node_modules/pqb/src/queryMethods/expressions.ts:219:12) at Array.<anonymous> (server/db/migrations/0044_tx_data.ts:15:36)
The text was updated successfully, but these errors were encountered:
No branches or pull requests