Open
Description
I tried to follow along with the example provided but when i run this code i get an error, stream.pipe is not a function. Im new to pg and nodeJS so Im not exactly sure where/how to fix this issue. This is the code i've been trying to run. Side note: Will running pg-query-stream allow me to use the results from the query in other js functions? Thanks, any help/advice is much appreciated.
const {Pool} = require('pg')
const QueryStream = require('pg-query-stream')
const JSONStream = require('JSONStream')
const pool = new Pool({})
const q = 'SELECT * FROM public."HexLogRecord"'
pool.connect()
var stream = pool.query(new QueryStream(q))
stream.pipe(JSONStream.stringify()).pipe(process.stdout)