Bun with drizzle
I am attemtping to use bun with drizzle-kit and i Keep getting this error
I am using planetscale mysql2 driver
29 Replies
anyone ðŸ˜
Did this code run perfectly in node?
Yes
@angelelz
does mysql driver just not function in bun?
I want to test bun, I just haven't gotten to it yet. I just wanted to make sure you were not trying to run this code in the client (browser)
nah im not lol
its being ran in WSL
but i find this weird as the drizzle docs
say everything can be installed with bun
so why wouldnt drizzle-kit work
Do you need th
x
? I think bun drizzle-kit push:mysql
should also work.
Could be wrong though. Did this with sqlite a few weeks ago.pushing does not work
it does not matter how i do it
its always the same error
sqlite is also built into bun
mysql isnt
which i wonder if this is the reason for the problem
isn’t it
bunx
not bun x
It works on my machine 😅
Do you have a drizzle.config.ts somewhere?
bunx is like npx, afaik
I feel like you should also be wanting to just run the drizzle-kit command no? wont npx/bunx the most recent version of drizzle-kit from npm?
deno better AHEM
What driver are you using
im assuming the mysql driver
can I see your config file?
because no matter what I do i constantly get the same error
GitHub
drizzle-playground/drizzle.config.mysql.ts at main · rphlmr/drizzle...
Contribute to rphlmr/drizzle-playground development by creating an account on GitHub.
That’s interesting
Are you using planetscale?
nope, I've just tested, curious about what happen
Because I need to have the reject authorize at the end of the url for it to work with planetscale
And I can’t pass that in as a object it needs to be in the url
That’s where the error comes from
But atleast that ruled out a driver issue
chances Bun doesn't support 100% of what the driver uses
Seems to just be that reject unauthorized at the end of the connection string
But I need that to work with planetscale
So idk at this point lol
does it work with node?
Yep
So we can be confident that it is a bun issue.
I saw that https://github.com/sidorares/node-mysql2/pull/1805
GitHub
Bun support by sidorares · Pull Request #1805 · sidorares/node-mysq...
#1801
add Bun to CI
fix caching_sha2_password errors
work around missing net.createServer by using Bun.listen
compressed protocol bun fixes
TLS bun fixes
( going to track last 3 items separa...
Wasn’t that commit merged though
It does seem it’s relevant though
Since this is about a secure connection to the database
Well it says that the last 3 tasks will be tracked separately
This was all the way back in January though 👀ðŸ˜
What is the likely hood this is updated at all
Seems like her merged changed
I’ll have to see if it works later
It doesn’t seem he did any changes though to TLS?
GitHub
Support bun and deno · Issue #1801 · sidorares/node-mysql2
Bun 0.5 added support for net and tls modules I did a quick tests and there are few issues connecting to the server when started from bun: call to TLSSocket._start() - this is undocumented method, ...
im just so confused since
in his pull request
it says he merged on jan29
so this 'fix'
atleast in the newest version of mysql2 doesnt seem to work?
or should I just get the package via github and require it that way instead of using npm
GitHub
SSL issues with Bun + drizzle · Issue #2227 · sidorares/node-mysql2
https://github.com/Djboy08/mysqldriver-issue/tree/main This is the GitHub repo where I made a minimum viable issue. When you have the DB_URL set up properly (in the readme) and you try to connect t...
Seems like this is drizzles fault?
they dont use the newest mysql version