drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
22.55k stars 536 forks source link

[FEATURE]: Add `mode: mariadb` to `mysql` #2007

Open varna opened 5 months ago

varna commented 5 months ago

Describe what you want

Hello,

We use mariadb at work. I don't know why, but seniors told me that "it's just a fork of mysql because of licensing". So I used it as any mysql. With mysql2 driver. While using Drizzle, I found out that mariadb doesn't support lateral derived tables, because my SQL for db.query failed on LEFT JOIN LATERAL.

I don't think that it would be proper to treat mariadb as different db, because in my experience, it feels closer to mysql than Planetscale (at least it has fkeys). So I wanted to ask, what do you think about having a new mode: mariadb for mysql in Drizzle?

Creative-Difficulty commented 4 months ago

+1, any updates?

milon27 commented 4 months ago

+1, any update?

phil-flip commented 4 months ago

While not being quite the same, someone made a PR a MariaDB driver, but yet to be merged. https://github.com/drizzle-team/drizzle-orm/pull/1692

L-Mario564 commented 3 months ago

While not being quite the same, someone made a PR a MariaDB driver, but yet to be merged. #1692

Just letting everyone know that my PR only partially solves this issue, as the RQB syntax (db.query) doesn't work due to MariaDB not supporting lateral joins. However, it would support the core API syntax (db.select).

The idea of a mode for MariaDB has only been briefly discussed with the team (that I'm not officially a part of), and the RQB API would need to be extended and tested extensively (at least, I think that would be the case).

aprilmintacpineda commented 2 months ago

There are valid reasons to use MariaDB over MySQL. I hope this gets implemented too 🙏 https://mariadb.org/how-mariadb-and-mysql-performance-changed-over-releases/