Category "knex.js"

How to Run Postgresql procedures with Knex in Node js

I am trying to call a stored procedure saved in the public schema using: const schema = await knex.raw("call create_schema(?, 'col1', 'col2', 'col3', 'col4', 'c

How to put a foreign key in knex migration?

I'm trying to put a foreign key in knex migration. "age_group_id"(primary key of the "agegroups" table) is the foreign key of the "users" table. So, I have put

Why is req.body undefined in Express?

I am creating a PUT method to update a given set of data however in my update function, req.body is undefined. controller.js async function reviewExists(req, re

How to use Knex object in other file?

How do I use the knex db object inside other files? For Example my index.js const app = require("express")(); const cors = require("cors"); const bodyParser

How to bulk insert in psql using knex.js?

I've searched a lot and this is deprecated question. I'm trying to bulk insert in a table. My approach was like this knex('test_table').where({ user: 'user@ex

Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

I am using the following code to make a knex connection, but frequently the error occurred Knex: Timeout acquiring a connection. The pool is probably full.