Reputation: 21865
I'm using PostgreSQL for a project , and for that I need a SQL database.
Anyone knows what's PostgreSQL equivalent to MongoDB's Mongoose ?
Upvotes: 10
Views: 8085
Reputation: 11
Here is a good article denoting some other ORM options for. JS: https://www.prisma.io/dataguide/database-tools/top-nodejs-orms-query-builders-and-database-libraries#prisma
In short:
Upvotes: 0
Reputation: 3651
If you are looking for a way to convert JSONB typed columns into objects that you can load update and save like you do using mongoose:
The § "JSONB (PostgreSQL only)" type in the sequelize documentation will show you how.
node-postgres might be an alternative
Upvotes: 1
Reputation: 4773
It depends on what you are coding in. Mongoose is an ODM or object data modelling tool for Node.js.
Those object modelling tools are typically tied to a particular language or framework. In Java, one might use Hibernate. In Django, there is a custom ORM (swap data for relational). With Node, one might use a tool like Sequalize.
Sequalize is probably the answer you are looking for.
Upvotes: 4