Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
63 views

I'm building an API using AdonisJS 6, Lucid ORM, knex-postgis, PostgreSQL and PostGIS. I have a posts table that includes a coordinates column of type geometry(Point, 4326). I want to store ...
Bilal's user avatar
  • 173
1 vote
1 answer
53 views

Currently I have a function like the following: type StudentGroup { student_group_id: number, id: number, name: number, student_max_score: number, } public async getTopGroupByScores(): Promise<...
Fer-de-lance's user avatar
0 votes
1 answer
87 views

Background I’m setting up Knex migrations on a PostgreSQL database running inside WSL2 (Ubuntu). My Node.js/Knex app (also in WSL) connects over the WSL IP to this Postgres instance. Everything ...
Angus Hally's user avatar
0 votes
0 answers
33 views

I want to update one single row in database, I tried to put the .limit(1), doesn't seem to work with Postgres. What would you do in this situation? list.map(async (i) => { await kx(...
angry kiwi's user avatar
  • 11.6k
0 votes
1 answer
46 views

I'm in a pretty common situation, but I'm struggling to figure out exactly how to achieve what I want by looking at Knex's documentation. I have a set of entities with a one-to-many relationship to ...
bambi's user avatar
  • 55
0 votes
1 answer
81 views

Say I have a SQL table named "Customers" that has a column named Delete (used in order to flag the row as deleted without losing the data in case we want to restore it or access logs from it,...
Michael P's user avatar
1 vote
0 answers
26 views

I'd like to use the capacitor database with its nuances for native platforms, but wrapped in Knex for query builder, is it possible? I didn't find any answer on the internet, even tho ChatGPT gave me ...
João's user avatar
  • 841
0 votes
1 answer
62 views

I am getting this error while trying to update a record in my model using objection.js. The error I am getting is Error: An error occurred while executing $setJson method. $setJson method was given an ...
oleksii pytts's user avatar
1 vote
0 answers
229 views

I am running some unit tests after a node version upgrade and jest version upgrade in package.json. It is erroring out with TypeError: Cannot read properties of undefined (reading '_setAdapter') The ...
africandrogba's user avatar
0 votes
0 answers
322 views

I am working on a Nodejs/Express application, and I am trying to connect to a newly created Neon postgres database with knex ORM. My knexfile.js file is below. I have taken the values of all the env ...
A_M's user avatar
  • 338
0 votes
1 answer
452 views

I'm diving into Strapi v5, and I noticed it now uses documentId. I want to use Knex.js to insert some records, but I’m a bit lost on how to handle the documentId column.
E C I N's user avatar
  • 201
1 vote
2 answers
499 views

I am using on conflict clause for insert query like this: insert into "public"."tbl" ("id", "col1", "col2") values ($1, $2, $3) on conflict ("id&...
Alex's user avatar
  • 66.6k
0 votes
0 answers
123 views

I am getting below when I am running the application, if you restart the node app error will not come, and everything works fine, this error occurs only few times. Dpi-1080 connection was closed by ...
Haneesh A's user avatar
0 votes
1 answer
168 views

I'm working on a nodejs server using Knex.js to connect to a postgres DB. On some of the tables I've set some RLS policies based on the current session values (app.user_id and app.tenant_id) to ...
lhoogenraad's user avatar
0 votes
0 answers
88 views

i am using knex db with mysql in wappler low code software and i have a column in my table and column name is is_active and it have bit datatype ig it means boolean right ? so when i use select query ...
Kabir Slashash's user avatar
1 vote
1 answer
271 views

Good afternoon. I'm trying to connect an oracle database with knex. However, I receive an NJS-500 message whenever I try to connect. I created a nodejs service with knex. I've tried different ways, ...
Marcelo Artigas's user avatar
1 vote
0 answers
108 views

I am using Knex and nodejs with Sqlite3. The table structure is as follows: --------------------------- | Parent | --------------------------- | - id (PK) | | - name ...
j4rey's user avatar
  • 2,707
1 vote
1 answer
97 views

I'm trying to make my knex code simpler by removing knex.from('table') or knex('table') from my queries to something like table.where(...).select() and by doing this I make sure I'm not pointing to a ...
AlfredoDaAs's user avatar
0 votes
0 answers
162 views

I am trying to pass a mysql2 connection pool to the Knex client by following the official documentation. However, the query execution seems to get stuck. Even though the insert query successfully ...
shariq arif's user avatar
0 votes
0 answers
118 views

Problem I'm trying to extend knex with a function that would return something that is not the queryBuilder instance. I guess the same way that .toSQL() returns an object that is not the queryBuilder. ...
Pierre Noël's user avatar
0 votes
1 answer
44 views

I'm building an app with node.js knex.js typescript zod and fastify, im trying to validate the emails so that when an email is inserted on the user registration, if it is a duplicate it throws status ...
Lucas Faria's user avatar
0 votes
1 answer
268 views

Exactly as the title says. I've got a simple transaction that should determine whether a record exists already, and update it if an image url has changed. Otherwise, create a new record. It looks like ...
Jimmy Blundell's user avatar
0 votes
1 answer
293 views

I'm encountering an issue while trying to connect to a Microsoft SQL Server database using Knex with system-assigned identity. Despite configuring Knex to utilize system-assigned identity for ...
Sumit Patel's user avatar
0 votes
1 answer
148 views

I'm seeking guidance on how to use PostgreSQL to update multiple rows in a specific column. I’m particularly interested in methods that offer optimal performance. Any help would be greatly appreciated ...
Jakub's user avatar
  • 2,769
1 vote
1 answer
40 views

I want to create a query like this with knex: select "data"."parent"."name" from "data"."parent" inner join "data"."child"...
Meyra's user avatar
  • 59
0 votes
0 answers
118 views

I am using knex.js with a postgresql database. I am looking into replacing moment.js with date-fns in my codebase and I am running into a really odd situation with the formatting of queries. We are ...
Manny42's user avatar
  • 668
0 votes
1 answer
163 views

I am using knex.js with OracleDB, attempting to use the object syntax in a select with query builder, like below. knex.select({ currentDate: "SYSDATE"}).from("dual") While this ...
Austin's user avatar
  • 107
0 votes
0 answers
146 views

I'm trying to run the command npm run update:db, and I'm having errors. Below is what the command runs (as it would appear in the package.json files): "update:db": "cd ../db && ...
Sana Saab's user avatar
2 votes
2 answers
4k views

I have an application backend hosted on Amazon Linux AMI, which I set up approximately 6 months ago. Initially, I used Node.js 17.x without much consideration as it was part of my AWS AMI setup. ...
Nirav Bhatt's user avatar
  • 6,989
0 votes
1 answer
357 views

When launching an electronjs app that has been osx signed and notarized with electron-forge I get the following error: Uncaught Exception: Error: Knex: run $ npm install sqlite3 --save dlopen(/var/...
MichaelB's user avatar
  • 394
0 votes
1 answer
991 views

I'm encountering a KnexTimeoutError when attempting to deploy my Node.js application's database changes using a series of npm scripts that utilize Knex migrations. My goal is to rollback all ...
RukshanJS's user avatar
  • 1,024
4 votes
1 answer
449 views

I'm working on a Node.js application using knex.js for database operations with PostgreSQL. My database has a users table with columns id and credits. The isolation level of my PostgreSQL database is ...
Noname's user avatar
  • 6,445
0 votes
1 answer
763 views

I'm wondering how I might get ahold of the better-sqlite3 connection that knex is using so that I can use better-sqlite3 methods directly on a knex connection. Specifically I'd like to use better-...
JonathanH's user avatar
1 vote
2 answers
82 views

I have the following table - orders: id value price amount 2 'orange' $12 7 8 'yellow' $14 29 5 'green' $17 9 I have to perform SELECT query with WHERE IN clause SELECT value FROM order WHERE id IN (2,...
TwittorDrive's user avatar
2 votes
0 answers
123 views

I am developing an Apollo GraphQL API with Postgres as database system. I have the following 4 Knex migrations for setting up a trigger-based audit log system, where the last snippet illustrates how ...
Åsmund Kvitvang's user avatar
0 votes
2 answers
243 views

I'm receiving connect ENOENT /cloudsql/<proj>:us-west1:<instance>/.s.PGSQL.5432 When connecting to a Cloud SQL instance of PostgreSQL 15 from a Firebase V2 Callable function. I've looked ...
Owain's user avatar
  • 19
0 votes
1 answer
231 views

I am using Knex with a MySQL database and am trying to migrate my tables using npx knex migrate:latest. However, when I run the command I am getting the following error: "Access denied for user ''...
kabirseth4's user avatar
3 votes
0 answers
639 views

In our codebase we sometimes have accidental transaction leaks where a transaction is opened with Knex but never closed. As a safety net we want to introduce a way to automatically close connections ...
autotoon's user avatar
0 votes
1 answer
300 views

I have a table entries linked with another table categories. There is also a column is_marked of type BOOLEAN. The user may want to see the marked entries separately, so I wish to show the count of ...
LeCarbonator's user avatar
0 votes
2 answers
84 views

const [user]: T = await db("users").insert(data).returning("*"); // error:Type 'T' must have a '[Symbol.iterator]()' method that returns an iterator. My knex query typescript ...
Mayank's user avatar
  • 59
0 votes
0 answers
274 views

I am developing an API in Nest using Knex: import { Injectable, NotFoundException } from '@nestjs/common' import { InjectKnex, Knex } from 'nestjs-knex' import { ICreatePersonData, IUpdatePersonData, ...
Werter Pires Gouveia's user avatar
0 votes
0 answers
98 views

const Knex = require('knex'); const { Connector } = require('@google-cloud/cloud-sql-connector'); const connectWithConnector = async () => { const connector = new Connector(); const ...
Dewek's user avatar
  • 27
0 votes
1 answer
315 views

I'm trying to run some operations on a Node Typescript project with knex. It is already configured and when using knex-cli to create or run migrations (just as an example) it works perfectly fine. The ...
Sergio Laureano's user avatar
0 votes
0 answers
966 views

We are getting Knex timeout error mostly during high traffic in production with postgresql database. The knex config is as follows: module.exports = { client: 'pg', connection: process.env....
Rohit Shrestha's user avatar
0 votes
0 answers
174 views

I'm facing an issue when trying to deploy a Node.js API that uses Knex, Express, and the SQLite database on Vercel. Since Vercel doesn't support SQLite, I'm seeking guidance on how to transform my ...
Christian Henrique's user avatar
-2 votes
1 answer
2k views

I have my local database. So i made aws databse, and migrated data following this yt video https://www.youtube.com/watch?v=Vi44UHVYWEg&t=8s&pp=ygUUbG9jYWwgZGF0YWJzZSB0byBhd3M%3D My connection ...
filip Kvesić's user avatar
0 votes
1 answer
555 views

I'm using Strapi v4 and facing an issue with populating a nested repeatable component in my API response. I have a repeatable component faq_item inside another component faqs. However, when I attempt ...
anis's user avatar
  • 915
0 votes
2 answers
414 views

My pagination works just fine without relations. But if I add images relation, I loose one post row. If I use only 1 image per post, no problem. I don't think the problem is with my join table, ...
Jeje Pro's user avatar
0 votes
1 answer
99 views

On my code I have something like: const getItem = async (itemId) => { const item = await knex('item').where('id', itemId).first(); console.log(item); }; And on my test file: sinon.stub(knex, '...
AlfredoDaAs's user avatar
1 vote
2 answers
49 views

I want to query items from Postgres database with knex. In the database, I have two separate columns first_name and last_name, but I need to compare them both to a single value which is formatted &...
Aleksandra's user avatar

1
2 3 4 5
50