DT
Drizzle Team•16mo ago
Headless

Bun with drizzle

I am attemtping to use bun with drizzle-kit and i Keep getting this error I am using planetscale mysql2 driver
No description
29 Replies
Headless
HeadlessOP•16mo ago
anyone 😭
Angelelz
Angelelz•16mo ago
Did this code run perfectly in node?
Headless
HeadlessOP•16mo ago
Yes @angelelz does mysql driver just not function in bun?
Angelelz
Angelelz•16mo ago
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)
Headless
HeadlessOP•16mo ago
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
MAST
MAST•16mo ago
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.
Headless
HeadlessOP•16mo 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
Screw
Screw•16mo ago
isn’t it bunx not bun x
rphlmr âš¡
rphlmr ⚡•16mo ago
It works on my machine 😅
No description
rphlmr âš¡
rphlmr ⚡•16mo ago
Do you have a drizzle.config.ts somewhere? bunx is like npx, afaik
NinjaBunny
NinjaBunny•16mo ago
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?
mavdotjs
mavdotjs•16mo ago
deno better AHEM
Headless
HeadlessOP•16mo ago
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
Headless
HeadlessOP•16mo ago
That’s interesting Are you using planetscale?
rphlmr âš¡
rphlmr ⚡•16mo ago
nope, I've just tested, curious about what happen
Headless
HeadlessOP•16mo ago
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
rphlmr âš¡
rphlmr ⚡•16mo ago
chances Bun doesn't support 100% of what the driver uses
Headless
HeadlessOP•16mo ago
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
rphlmr âš¡
rphlmr ⚡•16mo ago
does it work with node?
Headless
HeadlessOP•16mo ago
Yep
rphlmr âš¡
rphlmr ⚡•16mo ago
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...
Headless
HeadlessOP•16mo ago
Wasn’t that commit merged though It does seem it’s relevant though Since this is about a secure connection to the database
rphlmr âš¡
rphlmr ⚡•16mo ago
Well it says that the last 3 tasks will be tracked separately
Headless
HeadlessOP•16mo ago
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?
Headless
HeadlessOP•15mo ago
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, ...
Headless
HeadlessOP•15mo ago
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
Headless
HeadlessOP•15mo ago
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...
Headless
HeadlessOP•15mo ago
Seems like this is drizzles fault? they dont use the newest mysql version
Want results from more Discord servers?
Add your server