drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

Add support for Maria DB (core API implementation)

Open L-Mario564 opened this issue 1 year ago • 9 comments

(Partially) Addresses #203.

This PR aims to add support for Maria DB, which simply extends the existent MySQL dialect.

Tasks:

  • [x] Implement mariadb driver.
  • [x] Write core API integration tests for the mariadb driver.

Other changes implemented:

  • Remove fullJoin from MySQL dialect, as neither MySQL nor Maria DB support full joins.
  • Update Drizzle Kit version in the workspace.

Things maybe worth mentioning:

  • int auto_increment is used when creating tables in integration tests instead of serial because the latter creates a bigint in Maria DB.
  • When creating an instance of MySqlDatabase using the mariadb driver, Planetscale mode is used by default as Maria DB doesn't support left join lateral. (Maria DB Issue).

L-Mario564 avatar Dec 23 '23 20:12 L-Mario564

By removing fullJoin from MySQL dialect, #1125 is also addressed.

L-Mario564 avatar Dec 23 '23 21:12 L-Mario564

Due to issues I've discussed with the Drizzle team, this PR will only aim to provide MariaDB support with the core API, which means that RQB will come later and will likely be addressed in a separate PR.

L-Mario564 avatar Dec 28 '23 02:12 L-Mario564

@L-Mario564 Updates?

Creative-Difficulty avatar Mar 31 '24 19:03 Creative-Difficulty

@Creative-Difficulty Haven't heard anything from the Drizzle Team. They knew about this PR when I was done adding commits to it in December, but right now I don't know what's the status for adding MariaDB support.

L-Mario564 avatar Mar 31 '24 21:03 L-Mario564

@drizzle-team

Creative-Difficulty avatar Apr 11 '24 17:04 Creative-Difficulty

@drizzle-team

VergeDX avatar Apr 16 '24 09:04 VergeDX

This issue has 8 +1's and 14 hearts. The code has been written and @drizzle-team/@dankochetov potentially only needs to merge it. Wonder why this isn't this getting any attention?

ottok avatar Apr 26 '24 03:04 ottok

This issue has 8 +1's and 14 hearts. The code has been written and @drizzle-team/@dankochetov potentially only needs to merge it. Wonder why this isn't this getting any attention?

I can bring the Drizzle Team's attention to this PR, although keep in mind there's a lot of other stuff being worked on, including a new dialect (MSSQL), so I can't promise how soon this will be reviewed/merged.

L-Mario564 avatar Apr 26 '24 18:04 L-Mario564

maybe they should consider mariadb connector instead of mysql2, which is simply faster.

sbscan avatar May 08 '24 01:05 sbscan

Can we get some attention for this issue again? Me personally, I prefer postgres over everything, but one company expects our team to use mariadb as the database, but the normal mysql2 driver has a few problems. It would be nice if the native mariadb nodejs driver would be also supported in drizzle-orm. This way the most used databases would be covered. And I guess it should not take too much time, especially because some/most of the code is already written here. (Although I have no idea of this codebase, so it might be, that there is much more to do)

nachthammer avatar Jun 10 '24 08:06 nachthammer

Could you @AndriiSherman perhaps give some initial feedback so the submitter @L-Mario564 can iterate and finalize this for merging?

ottok avatar Jul 10 '24 00:07 ottok

Any reason this hasn't gone through yet?

robertsilen avatar Sep 04 '24 11:09 robertsilen

Just to give everyone an update, the team is working on polishing the existing drivers and dialects before integrating any new ones. Do expect this to be merged before Drizzle ORM v1 though.

L-Mario564 avatar Sep 13 '24 15:09 L-Mario564