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:
I think below ORM are good:
Which ORM or solution is best for my requests?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With