drizzle-orm
drizzle-orm copied to clipboard
[BUG]: drizzle-kit push TypeError: This statement does not return data. Use run() instead
What version of drizzle-orm are you using?
0.33.0
What version of drizzle-kit are you using?
0.24.0
Describe the Bug
When running npx drizzle-kit push and confirming, that I want to execute, I get this error:
TypeError: This statement does not return data. Use run() instead
at Object.query (/home/moe/Development/valonia/node_modules/drizzle-kit/bin.cjs:72146:53)
at sqlitePush (/home/moe/Development/valonia/node_modules/drizzle-kit/bin.cjs:74808:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.handler (/home/moe/Development/valonia/node_modules/drizzle-kit/bin.cjs:83114:9)
at async rawCli (/home/moe/Development/valonia/node_modules/drizzle-kit/bin.cjs:81492:5)
at async run (/home/moe/Development/valonia/node_modules/drizzle-kit/bin.cjs:81500:5)
Expected behavior
No response
Environment & setup
I'm on Fedora Linux
drizzle.config.ts:
import type { Config } from "drizzle-kit"
export default {
schema: "./src/lib/db/schema.ts",
out: "./migrations",
dialect: "sqlite",
dbCredentials: {
url: "./sqlite.db"
},
verbose: true,
strict: true
} satisfies Config
I am facing same issue did you get any answers on how to fix it
Nope
I had to downgrade to version 0.22.8 to get it working again
We're experiencing the same issue, downgrading to 0.22.8 (accomplished by ~0.22) has solved the issue. This seems to be a bug introduced in the 0.23.0 release, since 0.23.0 itself was still throwing the error.
Yup, same behavior happening in 0.24.0, downgrading to 0.22.8 fixed the issue.
My config looks like the following, I'm using better-sqlite3:
import type { Config } from "drizzle-kit";
export default {
schema: "./lib/dbSchema.ts",
out: "./drizzle",
dialect: "sqlite",
dbCredentials: {
url: "./sqlite.db",
},
verbose: true,
strict: true,
} satisfies Config;
@simontong @yamcodes @ahmad1702 Thanks for sharing input Same in our team - after stuggling for a few days - we've regressed back to version 0.22.8, which solved the issue.
I were on 0.24.2 and downgraded to 0.22.8 and this fixed my issue. So the bug is still there in 0.24.2
Confirming I also encountered this issue on 0.24.2 and also solved it by downgrading to 0.22.8.
Related to
- https://github.com/drizzle-team/drizzle-kit-mirror/issues/500
- #2623
Workarounds:
- https://github.com/drizzle-team/drizzle-kit-mirror/issues/500#issuecomment-2229782233)
- change
querytorundirectly in the package
- change
- https://github.com/drizzle-team/drizzle-kit-mirror/issues/500#issuecomment-2239083475
- use
migrateinstead ofpush
- use
- Or downgrade to
v0.22.8as discussed.
There is a draft pull request here that fixes the issue:
- https://github.com/drizzle-team/drizzle-orm/pull/2959
Basically applying the first "workaround" change above:
https://github.com/drizzle-team/drizzle-orm/pull/2959/files#diff-175921cf89e73c94f44fd1a05f60a0378c3c2463b032a87cd3450e40653bc11dR365
Both versions on latest, still happens.
Closing in favor of #2623.