Open tslater opened 1 year ago
There was a pull request for this, but it has been closed due to complications between the planetscale and mysql2 adapters differing in terms of behavior: https://github.com/drizzle-team/drizzle-orm/pull/425
💎 $200 bounty created by @tslater 👉 To claim this bounty, submit your pull request on Algora 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to drizzle-team/drizzle-orm!
There's anyone already working on it?
I would like to help with it 😄
@ologbonowiwi Do you think you can pound through it quickly? I thought there was someone on here that said they wanted to, but I only see it in my email and not here. I wonder if it was deleted? I say go for it since it's been a week and no sign of them.
I'm not sure @tslater.
I want to help but I don't know the project internals, so it'll be quite a challenge.
/attempt #1188
@ologbonowiwi Hey! Thanks for sending me a DM on linkedin, I have my github completely muted and missed this.
I had tried getting it working but as in the PR, the mysql2
package (which is API compliant with the mysql
package) parses binary
and varbinary
columns as Buffer while the @planetscale/database
parses them as string | null.
I tried playing around to get it to work but ran into the issue that they both rely on the drizzle-orm/mysql-core
sub-package (specifically the MySqlVarBinaryBuilderInitial). So changing the column definitions in one changes them in the other.
Life got busy and I converted to neon / postgress in my projects so I abandoned it.
Hope I could help, but this is pretty complicated and I'm not sure how to fix it. Let me know if you need anything else!
Thanks for the clarification, @ryanagillie; only this comment helped a lot!
The work on #1253 from my side is mostly done, this was the last update from @AndriiSherman on the discord thread.
Posting it here so we have the issue updated.
@AndriiSherman any updates?
What version of
drizzle-orm
are you using?0.28.5
What version of
drizzle-kit
are you using?0.19.13
Describe the Bug
The mysql2 library parses binary & varbinary columns as Buffer.
They also automatically convert Buffers to hex strings, so passing those in to a query is escaped correctly.
Expected behavior
The type should be Buffer
Environment & setup
Generally