Category "pg-promise"

How to get value from db.any() promise in pg-promise?

I use pg-promise and i tried to make a request to database in user model to get an array of all users like this: exports.getAllUsers = function () { let

PostgreSQL error: Connection terminated unexpectedly for long queries

I'm trying to add tens of thousands of Twitter profiles to a PostgreSQL database using the function below. The Twitter part works great - I get batches of 5000

How to use the clone function in pg-mem?

I'm trying to use pg-mem with the pg-promise adapter for testing my database layer. Initially I've tried fetching a fresh database for each test: import { newDb

How to register pg-promise with hapi

I try to register pg-promise as hapi plugin. However, the following error occurred. TypeError: Cannot read properties of undefined (reading 'name') at interna

WHERE col IN Query with empty array as parameter

From example where-col-in example and this answer, WHERE IN clauses should have query with parameters with following syntax const response = await db.any('SELE