brianc/node-pg-native

pg-native causing deprecation warnings

Closed this issue · 4 comments

Just upgrade to pg 6.3.0 and we're using pg-native as our client, now getting this:

↳ node --trace-deprecation test/db.spec.js 
Using database td4e5da3ca247b5741f273cef5bc03eea
(node:13624) DeprecationWarning: Using the automatically created return value from client.query as an event emitter is deprecated. Please see the upgrade guide at https://node-postgres.com/guides/upgrading
    at Result.module.exports (/home/todd/src/showrunner/node_modules/@scriptollc/scriptodb/node_modules/pg/lib/native/query.js:30:8)
    at new Result (/home/todd/src/showrunner/node_modules/@scriptollc/scriptodb/node_modules/pg/lib/utils.js:146:13)
    at Client.query (/home/todd/src/showrunner/node_modules/@scriptollc/scriptodb/node_modules/pg/lib/native/index.js:167:15)
    at Object.exports.setup (/home/todd/src/showrunner/node_modules/@scriptollc/scriptodb/test/test-init.js:28:10)
    at Object.<anonymous> (/home/todd/src/showrunner/node_modules/@scriptollc/scriptodb/test/db.spec.js:13:6)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3

sorry this looks like it's for the pg lib, not this one?

I see this is to-do'ed in the codebase!

Hey @toddself - I'm just letting you know with that message that using event emitters from client.query is deprecated. It should still work. you can also suppress those deprecations if you want via this. Here's a migration guide that should hopefully help you out: https://node-postgres.com/guides/upgrading

Thanks for the comment @brianc -- we're not attaching or using the events on the returned value at all so I was worried that something was happening that was wrong on a deeper level :). We'll wait until everything gets updated. (And am always happy to help do work on this!)