Saturday 31 August 2019

Critique my work. In house database migration handler for node-postgres ('pg').

I love NodeJS but don't like using an ORM. I like working with raw sql and the 'pg' module works just fine for me. The one thing stopping me from ditching an ORM was database migrations. I tried out TypeORM and noticed it tracked migrations using a migrations table and stored the name of the last migration that was run. Generating files with a timestamp and creating a migrations table didn't seem like a lot of work so I did it myself. Now I get the benefit of using migrations and not having to learn how to use an ORM.https://github.com/seanpmaxwell/InHouseDbMigrationHandler​P.S. the reason I didn't like using an ORM was cause I didn't like having to double check the SQL in my migrations and having to google how to do queries with the ORM when I already know SQL. I was like, what's the point of an ORM if I have to double check my sql anyways?

Submitted September 01, 2019 at 04:46AM by TheWebDever

No comments:

Post a Comment