PostgresError: server requires encryption)
Client instance on req, rather than create it for each query? i.e. instead of:req is new every time and the client will be recycled.req.client will still be unused (unlikely it will be but possible?)req.cf?req.cf.client some day for some service or another.req between middleware. Otherwise you'd have no option but to laboriously pass around manually a ton of data as function arguments.ctx or similar.PostgresError: server requires encryptionconst runQ = async q => {
const client = new Client(/* options */);
await client.connect();
return client.query(q);
}const runQ = async (req, q) => {
if (!req.client) {
req.client = new Client(/* options */);
await req.client.connect();
}
return req.client.query(q);
}req.clientreq.cfreq.cf.client