Most voted "knex.js" questions
Knex.js is a query builder for Postgres, Mysql and Sqlite3, Oracle and MS SQL Server. It is designed to be flexible, portable and fun to use. It features traditional node-style call returns, as well as a promising interface for cleaner asynchronous flow control, full-featured query and schema builders, transaction support, connection pool, and standardized responses.
Learn more…18 questions
Sort by count of
-
1
votes1
answer54
viewsMy inaccessible JSON key for Node.js validation
I am developing an API in Node.js and Knex.js, but I came across a problem, the array that Knex returns in the promise has a JSON inside and is numerical that needs to be validated. However, the key…
-
1
votes2
answers636
viewsReturn of a Knex query using . map
Good afternoon, you guys. I have a Controller that receives data from a frontend spreadsheet, read the dice and play these to run a query in the database, so my intention is to play the results back…
-
1
votes1
answer26
viewsHow do I use WHERE using Knexjs as a conditional?
I am doing a put route to update, and using knexJS to update the data in the database, and in my code the solution I found was this below: dbKnex("game").where({ id: id }).select("*").then(data…
-
1
votes1
answer99
viewsWhere in a select on a system using a many relationship type for many
I’m making a basic system that has a table of projects, one of tags and a pivot table, project_tag. Each project has a id, title and a tag. The table of tags has a id and a title . The table…
-
0
votes0
answers63
viewsKnex - Nodejs Doubt (Graphql)
I want to return all my data from this table in my database. I am making the following query: async licitacaoAll(_, { dados }) { if (!dados) return null const { ativo } = dados return await…
-
0
votes1
answer107
viewsUndefined for the body of a request
I’m trying to create a Postings in Node, where a post will have the following fields : Category, title and Description. The entity responsible for making this feature is called posts, which is…
-
0
votes1
answer67
viewsHow to return the data registered in the database using Sqlite3
Good evening guys, okay I’m new here, and I have the following problem, I’m using knexJS with Sqlite3, I was able to do the Insert and is registering the data normally in the database, but when I…
-
0
votes0
answers48
viewserror when connecting the Knex to the oracle Database
I am trying to connect the database to the nodejs with the Knex, but when making a call on the connection I get the following error, Unhandledpromiserejectionwarning: Error: DPI-1047: Cannot locate…
-
0
votes1
answer591
viewsmkConfigObj Knex error
I’m creating an Migration from the Knex, but when I run the command npx knex migrate:latest --knexfile knexfile.ts migrate:latest I get the following error: No Configuration file found and no…
-
0
votes1
answer145
viewsKNEX: How to create an array from the result of the query in Sqlserver?
I am using the Knex to make a query that united several tables from a bank Sqlserver (use two version of Sqlserver 9.0.3042 and 12.0.5000.0), example: knex('tabelaA') .join('tabelaB',…
-
0
votes1
answer196
viewsCreating Migrations using module.Exports
Hello, I’m trying to create a Migration using the knex, but the knex does not accept the export default then as an alternative I am using the import mode ECS5 (ex: const knex = require('knex) and…
-
0
votes1
answer58
viewsCompare if the value of a variable is the same as the value already saved in the database
Using Java Script, Nodejs, Adonisframework, Mysql, Lucid ORM I need to check compare if the value sent by the client through the API is the same present in my database. I need to check if the…
-
0
votes1
answer30
viewsCommand Destroy in Javascript
I am starting my studies in JS and came across a problem generated by the use of the function. I am using knex and Node.js to connect to a Mysql database. For this I used as an example the tutorial…
-
0
votes0
answers5
viewsHow to format knex date with postgresql
I am using knex together with postgres and created a Migrations table.date('birth').notNull(), in the postgres table when I do a query the date is saved in the format 1996-08-06, but when I call the…
-
-1
votes1
answer93
viewsError deleting a BD widget from a column
I’m trying to create a Postings in Node. A post can be created, shown or deleted. For this I created a table called posts with the following fields : table.string('category').notNullable()…
-
-1
votes2
answers655
viewsDocker Compose + Postgres + Nodejs + knex API Connect in Bank
Hello I am studying Docker Compose, I made a simple API to make user CRUD, but I want to climb a container to run the Node and one with postgres and they communicating I did the following 'Docker…
-
-1
votes1
answer87
viewshow to get an id with knex and typescript?
I am creating my database with Knex for an application made in React with Typescript. The application will be a service contracting site, where a service provider registers his work and a user…
-
-1
votes1
answer61
viewsProblems creating schema by Knex js
I am trying to create a relationship scheme between tables in Node express, and that apparently is right, even so is generating this error message. knex migrate:Latest migration file…