node-pg-query icon indicating copy to clipboard operation
node-pg-query copied to clipboard

breaking changes from pg 6.0.3 to 7

Open jasontenbrink opened this issue 8 years ago • 4 comments

I get this error when on the later version

TypeError: (query.pg || pg).connect is not a function at module.exports (/Users/Freddy/project/node_modules/pg-query/index.js:48:20)

switching back to 6.0.3 fixes the issue.

jasontenbrink avatar Sep 21 '17 23:09 jasontenbrink

hmmm. This may be because I installed pg independently from pg-query. This may not be an issue.

jasontenbrink avatar Sep 21 '17 23:09 jasontenbrink

doing some more investigating, it looks like this is a bug. pg-query won't work with pg7+

jasontenbrink avatar Sep 24 '17 15:09 jasontenbrink

I can confirm the same issue. Reverting pgto 6.2.3 fixes this problem.

ewan-sinclair avatar Nov 27 '17 20:11 ewan-sinclair

This seems to fix the issue. I am doing some more testing though:

try { const { Pool } = require('pg'); var pg = new Pool(); //var pg = require('pg'); } catch(e) { try { const { Pool } = require('pg'); var pg = new Pool(); //var pg = require('pg.js'); } catch(e) { throw new Error("Could not require pg or pg.js - please install one or the other") } }

Lawrence-Sproul avatar Feb 02 '18 22:02 Lawrence-Sproul