DEV Community

Discussion on: Persisting a Node API with PostgreSQL, without the help of ORM's like sequelize.

Collapse
 
slidenerd profile image
slidenerd

Many standard practices have not been followed
First of all you dont need to call pool.end Check this Github Issue on pg github.com/brianc/node-postgres/is...
Secondly, you havent structured the repo as per the standards mentioned by the repo owner, Check this section of the documentation node-postgres.com/guides/async-exp...
Thirdly you are not using migrations to create the tables, that is how you would do it in production, you should use a package like github.com/salsita/node-pg-migrate to create migration files, then run the DML queries only via pg, I dont have anything against you but an incomplete article such as this sways the newbies into NOT following the standard practices which is bad in the long run, if you dont have the time for rewriting this post, let me know, I ll be happy to correct everything and link back to your post

Collapse
 
ogwurujohnson profile image
Johnson Ogwuru • Edited

Okay

Collapse
 
vikrantsingh47 profile image
vikrant singh • Edited

is using an orm like sequalize a good idea as we can also write raw sql queries in it?