Friday 19 May 2017

node.js - reconciling Sequelize and pg-large-object

I am working on a Node.js project that uses Sequelize on top of PostgreSQL. However, I need to store large binary files in PostgreSQL as part of this, and I have not found an efficient way to do so with Sequelize. But I have found pg-large-object, middleware that facilitates interacting with PostgreSQL's large object facility. So I'd like to let Sequelize do what it can do, but drop down to pg-large-object for large object I/O.

But Sequelize wants to create a pg connection pool, and pg-promise, which underlies pg-large-object, wants to make its own connection. pg-promise does have pg underneath, and will give it up, but I see no way to tell Sequelize to use it.

Is there any way for Sequelize and pg-large-object to share a pg connection pool? Or am I stuck with two pools? Or is there an efficient way to use Sequelize for large objects that I have missed?



via Eric Hill

No comments:

Post a Comment