Open itsyoboieltr opened 5 months ago
On windows I'm having a similar issue but it just crashes instead
PS D:\company\project-api> bunx --bun drizzle-kit studio
drizzle-kit: v0.20.14
drizzle-orm: v0.30.7
No config path provided, using default path
Reading config file 'D:\company\project-api\drizzle.config.ts'
[Warning] Drizzle Studio is currently in Beta. If you find anything that is not working as expected or should be improved, feel free to create an issue on GitHub: https://github.com/drizzle-team/drizzle-kit-mirror/issues/new or write to us on Discord: https://discord.gg/WcRKz2FFxN
46193 | $2.log({
46194 | kind: "cmd",
46195 | cmd: this._command,
46196 | verbose: $2.verbose && !this._quiet
46197 | });
46198 | this.child = $2.spawn($2.prefix + this._command, {
^
TypeError: Executable not found in $PATH: "C:\Program Files\Git\bin\bash.EXE"
code: "ERR_INVALID_ARG_TYPE"
at spawn (node:child_process:650:15)
at node:child_process:2:41
at run (D:\company\project-api\node_modules\drizzle-kit\bin.cjs:46198:22)
at D:\company\project-api\node_modules\drizzle-kit\bin.cjs:46150:59
46193 | $2.log({
46194 | kind: "cmd",
46195 | cmd: this._command,
46196 | verbose: $2.verbose && !this._quiet
46197 | });
46198 | this.child = $2.spawn($2.prefix + this._command, {
^
TypeError: Executable not found in $PATH: "C:\Program Files\Git\bin\bash.EXE"
code: "ERR_INVALID_ARG_TYPE"
at spawn (node:child_process:650:15)
at node:child_process:2:41
at run (D:\company\project-api\node_modules\drizzle-kit\bin.cjs:46198:22)
at D:\company\project-api\node_modules\drizzle-kit\bin.cjs:46150:59```
What version of Bun is running?
1.0.25+a8ff7be64
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
Run any command with drizzle-kit using --bun, for example:
drizzle-kit generate:pg
ordrizzle-kit push:pg
. The command should execute without any errors, but it cannot see any db schema files, so the effect of the command will be invalid, most of the time this results in bun dropping your whole db. The reason for this is detailed in this issue on the drizzle-kit-mirror repository: #199For reproduction, feel free to use this repo: dbest-stack
DATABASE_URL
inside .env to the url of your postgres databasebun push
drizzle-kit push:pg
(becausebun --bun drizzle-kit push:pg
is buggy), so it should push your schema successfully.push
script inside thepackage.json
fromdrizzle-kit push:pg
tobun --bun drizzle-kit push:pg
bun push
What is the expected behavior?
The db schema is pushed, migrations are generated.
What do you see instead?
The db is dropped (on push), the migrations are not generated.
Additional information
Seems to be something with Object.values or require?