I'm using Node and the node-postgres package and I would like to perform some unit tests using jest and supertest without saving to the actual database.
When using sequelize it is possible to configure the storage in memory, like so:
const sequelize = new Sequelize({
...
storage: ":memory:"
});
I know it is possible to set the dialect to Postgres in sequelize, but I was wondering how would one go about to set the in memory storage using node-postgres. Is that possible?
Thanks
CodePudding user response:
I think in sequelize that ":memory:" storage would be available only for sqlite like in memory databases. It isn't possible to run postgresql in memory so you can't connect to in memory postgres from node-postgres/any client.
You can refer this answer for more details (Using in-memory PostgreSQL)