All Questions
3,625
questions
-1
votes
0
answers
18
views
How to fix 'ER_FK_CANNOT_DROP_PARENT' error, 'ER_NO_SUCH_TABLE', 'ER_BAD_FIELD_ERROR' in Sequelize for MySQL? [duplicate]
When I run my server.js file I get the error mentioned in title.Also I get null violation errors when trying to insert into the TreeSeeds table. There is a foreign key called seedcompany_id in the ...
0
votes
1
answer
32
views
How to get Sequelize to recognize by primary key with MySQL database data set and fix bulkCreate() issue?
So I have a database where I am trying to establish a one-to-many relationship between Supplier and TreeSeed, whereby one Supplier can sell many TreeSeed. I have looked at the sequelize documentation ...
0
votes
1
answer
54
views
How to get Sequelize to recognize my custom foreign key and primary keys in a one-to-many relationship in MySQL during bulkcreate insert?
I am building a plant/arboretum style application in JavaScript. I am trying to create a one-to-many relationship between Supplier model and TreeSeed model. Meaning that one supplier can sell multiple ...
0
votes
0
answers
25
views
await is only valid in async functions and the top level bodies of modules nodejs [duplicate]
Basically using Nodejs I connect to mysql and create a pool using below code which works fine,
db.js
const mysql = require("mysql")
exports.database = mysql.createPool({
host: "...
-1
votes
2
answers
84
views
MySQL insert query successful but not inserting into database table
I am working on a React/MySQL registration page. The insert query runs, but is not inserting into the database table. I am not sure why.
In the backend folder, I have my server.js file:
const ...
0
votes
0
answers
22
views
How to Efficiently Handle Real-Time Forex Data Updates and Database Synchronization in Node.js?
I'm developing a Forex trading application using Node.js, where I need to handle real-time updates for around 600 currency pairs. The data comes from a FIX protocol engine and needs to be updated in ...
0
votes
0
answers
32
views
Error connecting to the database: getaddrinfo ENOTFOUND when trying to connect to mysql container using node js
and I keep getting this error when trying to connect to my mysql image through in node.js project
Error connecting to the database: getaddrinfo ENOTFOUND 98b6c7aeb8af
I can access the container fine ...
0
votes
0
answers
25
views
I am unable to filter data in many to many relationship in sequelize
I have three tables/models in sequelize, Teachers, Classes, and Divisions. I have established many to many relationship between Teachers and Divisions. and One to Many relationship between Classes and ...
0
votes
0
answers
91
views
Nest js, TypeOrm Connection close issue
I'm using NestJs, and Typeorm (MySQL driver). From time to time I get the 'Connection lost: The server closed the connection.' error.
The server that I'm using closes the connection after 10-15 ...
0
votes
1
answer
30
views
Sequelize query to filter records created one year ago based on created_at date
I'm working with Sequelize in a Node.js application and need to write a query that retrieves data where the created_at date is exactly one year old.
Here's the current query I'm using:
const newGrants ...
0
votes
3
answers
105
views
javascript MySQL - using Promise-await-async constructs, can't get code to wait for query completion
I've tried multiple versions of example code but can never seem to get something that guarantees completion of the query set before other code commences. I was under the impression that 'await' makes ...
1
vote
2
answers
92
views
Fetch API Skipping .then() Block After POST Request in Node.js: JSON Response Not Processed
I'm using the fetch API in my JavaScript code to make a POST request to a specific endpoint. However, I'm encountering an issue where the fetch call seems to skip the .then() block entirely and goes ...
0
votes
1
answer
40
views
Mysql2 messing with routing
I am trying to use mysql2 in the backend but it seems to messing with my routes when I use it in production.
My server file looks like this:
const express = require('express')
const app = express()
...
0
votes
1
answer
38
views
Unable to setup One to One relationship in NestJs using TypeORM and mysql
In my nest application I have two tables Users and Profession I want to create OneToOne relationship between these two tables.
Below code demonstrates how I am achieving it, but it's only saving data ...
0
votes
0
answers
29
views
Prisma, search for two userId in a list
i am making a web app using NextJs, in which i'm currently making the chat rooms.
When a user want to start a conversation the website will check in the db is there is an existing room for these two ...