Open erik-beus opened 4 years ago
Yes, it is definitely possible to add MySQL support to PgTyped, it is also on the project roadmap. It might take some time until I get to that task, but I am sure we will support it one day.
I totally understand the desire to do this, but there is a part of me that wishes you don't :)
It will take time to get a decent adapter interface to work against multiple databases with and inevitably you will lose some of the fidelity in code generation you have by working directly with Postgres - including making it easier to support Postgres-specific features (geodata and triggers spring to mind) in codegen. Testing will be harder, bugs more plentiful.
Having said that it is nice to avoid lock-in to a particular database, and the ability to work against embedded SQL databases would be very nice (such as sqlite).
It would be a good idea to have committed maintainer for the adapter layer or particular databases on board in my opinion before starting though. A cross-database reflection library would be a significant (and useful) library in its own right.
I partially agree here, it will definitely take some effort to make a reusable adapter for different DBs. Building a new introspection and reflection backend will also be time consuming. On the good side, MySQL on the introspection and protocol level is very similar to Postgres.
I dont think adding support for another DB should necessarily make the Postgres part worse, but it can surely dilute the library focus. To me the best strategy for now is to prioritize perfecting the Postgres dev experience and work on adding other DB backends once the Postgres experience is robust enough.
I will also be leaving this ticket open to track user demand for MySQL, so if someone sees this and would like to use PgTyped with MySQL - please leave a message or put a thumbs up somewhere 😄
Good project here :clap:! My team works with MySQL and want moving from using typeorm (because lack of support to complex queries and other incoveniences with its query builder) to a schema-builder and raw sql queries with typescript support
I really like the approach of this project. But I use MySQL. Hope to support MySQL in the future, thanks.
Would be really awesome having support for MySQL, specially now that PlanetScale is getting more and more popular and a lot of people are starting to use MySQL nowadays because of them
I really like the approach of this project. We're using MySql though - any chance this will support MySql? :)