I'm seeking for a good ORM for postgres under Node.js, one that supports declaration of relationships beetween models, and fields validation. I've searched during a long time and cannot get any satisfying results. Maybe someone can point me to a project I missed during my researches. Thx.
Using node-postgres , you will be able to write Node. js programs that can access and store data in a PostgreSQL database. In this tutorial, you'll use node-postgres to connect and query the PostgreSQL (Postgres in short) database. First, you'll create a database user and the database in Postgres.
Object Relational Mappers (ORM) Node.js. Object Relational Mapping is a simplified way of converting data between relational databases and objects. Many times we encounter scenarios where we have to write complex SQL query statements to perform CRUD operations from a database.
List of ORMs: sequelize: Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server. TypeORM: Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Oracle, sql.
node-orm2 looks good: supports association, validators, and mysql, postgres, and mongo (in beta)
UPDATE: The node-orm2
package is no longer maintained. Possible alternatives include bookshelf or sequelize.
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