Skip to main content

All Questions

0 votes
1 answer
32 views

ORM Sequelize model.upsert() is not a function

Version sequelize 6.37.3 I try to upsert() myModel but the mehtod returns: TypeError: model.upsert is not a function my_model.controller.ts ... class MyModelController { private model: any; ....
rammi22's user avatar
  • 395
-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 ...
RendezYT's user avatar
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 ...
RendezYT's user avatar
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 ...
RendezYT's user avatar
0 votes
1 answer
32 views

Sequelize code first with mysql cannot generate database

I am facing an issue related to sequelize when generating the database by commandline npx sequelize-cli db:migrate The firsting I installing my sql and using MySQL Workbench to connect it -> ...
hhpr98's user avatar
  • 65
0 votes
1 answer
19 views

How do I search an entry in database by the same search phrase for two separate models with reference in sequelize?

I'm trying to make a search in a database for invoices. In the server request handler I have only one thing: searchPhrase. So I have to search invoice by serial number of the invoice, and also by ...
justelio19's user avatar
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 ...
Nitin C's user avatar
  • 23
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 ...
Numaira Nawaz's user avatar
0 votes
0 answers
14 views

How to solve many-to-many relationship for inserting an element in Sequelize?

I have the following tables in my MySQL database: CREATE TABLE idi_ma_products ( id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(200), image VARCHAR(255), created_date DATE, ...
Sebastian Narvaez's user avatar
0 votes
0 answers
17 views

Trouble Generating Tables Automatically in Nodejs Using Sequelize mySQL 2

I'm encountering an issue where I'm unable to automatically create an "employee" table using Sequelize in my Node.js application. Strangely, while my "user" table gets created ...
Arjun Chand's user avatar
0 votes
0 answers
36 views

Multiple http requests to backend with nodejs and sequelize

I am developing a service in NodeJS using Express and Sequelize as ORM. I am also using the Serverless Offline plugin to emulate AWS Lambdas and I also deploy my backend in AWS Lambdas. My question is ...
usuario's user avatar
0 votes
1 answer
181 views

Inconsistent behavior with Sequelize .forEach() in MySQL vs. SQLite when updating records

I encountered a strange behavior with Sequelize when using MySQL. This script creates a table with one column and then seeds a record into this table. It then uses .forEach() and for (const ... of ...)...
Gea-Suan Lin's user avatar
0 votes
0 answers
39 views

import SQL data into a database using Node.js and Sequelize

optimizing the execution time for inserting a large volume of data into the database using Sequelize Initially, I was running around 20,000 queries individually through Sequelize, but it was taking ...
Adan Op's user avatar
0 votes
1 answer
23 views

Getting error in fetching data with Sequelize for Mysql Database (Backend Node.js)

I am using Sequelize ORM with mysql database for nodejs application. Somewhere I am stuck with one api whose job is just to show list based on the queryparam values. Issue is when I am not applying ...
user23602596's user avatar
0 votes
0 answers
28 views

Sequelize findAndCountAll with literal count and having clause and subquery getting column not found on subquery column for count,

Sequelize findAndCountAll with having clause and subquery getting column not found on subquery column for count, tried subQuery:false and subQuery:true but not worked, tried with finAll but i need ...
smzhzr's user avatar
  • 3

15 30 50 per page
1
2 3 4 5
121