1

I have a node js project in which I want to have connection with Postgresql and MSSQL. I'm not sure if I just use DB Drivers (pg & node-mssql npm packages) or it would be better Sequelize, because I can use raw queries with Sequelize and through which only have one package for all of them.

1 Answer 1

3

Sequelize is a higher level library than pg or node-mssql. It provides an Object-Relational Mapping (ORM) interface that provides useful functions and structures for interacting with a relational database from Node. Underneath it still relies on the database driver for the database you want to use, so it will be less performant than using raw queries directly, but the tradeoff is ease of use and more guardrails to make sure things were done correctly.

If you don't need the any of the features provided by Sequelize, just query the database directly for more performance. If you need any of the abstraction or ease-of-use features of an ORM, use Sequelize.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.