Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which ORM is best for nodejs? [closed]

Tags:

node.js

I am nodejs developer. I want to create online shop website with api for mobile applications also (android, ios). But I am not decide which ORM can be used for my requests. I am using postgresql database.

Request:

  1. Fast connections, responses (fastest for all)
  2. Clean understanding code
  3. Secure

I think below ORM are good:

  1. express + sequelize
  2. loopback ......

Which ORM or solution is best for my requests?

like image 399
Benfactor Avatar asked Oct 24 '18 09:10

Benfactor


4 Answers

ObjectionJS is a good one in my opinion. It uses KnexJS SQL query builder. Both are compatible with TypeScript. Knex uses migration pattern so you can rollback to your previous state with single command. It's migration system is more like Laravel's famous Eloquent.

like image 181
Shihab Avatar answered Sep 20 '22 18:09

Shihab


Checkout Typeorm

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8). Its goal is to always support the latest JavaScript features and provide additional features that help you to develop any kind of application that uses databases - from small applications with a few tables to large scale enterprise applications with multiple databases.

TypeORM supports both Active Record and Data Mapper patterns, unlike all other JavaScript ORMs currently in existence, which means you can write high quality, loosely coupled, scalable, maintainable applications the most productive way.

like image 16
Bo Vandersteene Avatar answered Nov 11 '22 17:11

Bo Vandersteene


I am using Typeorm with Postgresql. I've been trying sequelize too, but finally I decided to use typeorm because the code is clean and maintainable, your code is elegant and easy to read, support multiple DBMs, decoratos, it's a great ORM. I am using it with Typescript and Express. I hope you can actually consider using it.

like image 9
Juan Cruz Méndez Avatar answered Nov 11 '22 17:11

Juan Cruz Méndez


I prefer Sequelize ORM as it has a better query syntax in my opinion and when you add something like sequelizejs-decorators you get the nicety of decorators to define your tables with the better query syntax.

like image 8
weagle08 Avatar answered Nov 11 '22 16:11

weagle08