juanluispaz / ts-sql-query

Type-safe SQL query builder like QueryDSL or JOOQ in Java or Linq in .Net for TypeScript with MariaDB, MySql, Oracle, PostgreSql, Sqlite and SqlServer support.
https://ts-sql-query.readthedocs.io/
MIT License
291 stars 19 forks source link

How to integrate ts-sql-query with migrations? #113

Closed Motii1 closed 1 year ago

Motii1 commented 1 year ago

Hi, I am coming from ORMs background and I am wondering what is the best way to handle migrations with ts-sql-query?

What do you recommend? Maybe it is also a good question to add it to the FAQ

juanluispaz commented 1 year ago

Hi,

Good Idea, I will add it, meanwhile a quick summary.

If you are coming from an ORM it is common ORM offers you the possibility to create/migrate the database using an Object model as a starting point; that is useful in small and non-complex projects. If you want to use SQL, you want full power over SQL, especially if you need to migrate complex data between versions.

There are two different approaches you can use when you work with SQL first:

Hopefully, I have provided you with enough information in this text. Let me know any comments or questions, and I will gladly answer you.

Motii1 commented 1 year ago

@juanluispaz Wow, that's a great answer. Thank you!