Skip to main content

Questions tagged [sequelize.js]

The Sequelize library provides an ORM (Object-Relational-Mapper) for Node.js, written entirely in JavaScript. Provides easy mapping for MySQL, MariaDB, SQLite, PostgreSQL and SQL Server.

sequelize.js
0 votes
0 answers
18 views

nodejs sequelize node beforeConnect hook not working

I am trying to retrieve creds and configure in this 2 ways but its not working. Now getting any logs from this when I run the lambda! import * as seq from 'sequelize'; import { retriveCredentials } ...
Akshay Bhanderi's user avatar
0 votes
0 answers
19 views

why does findOne method on sequelize just compare on the Id column of table

so this code that is a route I have created using sequelize library on mysql database const { user_name } = req.params; const user = await User.findOne({ where: { username: user_name } }); it has to ...
Sadegh Madhi's user avatar
-1 votes
0 answers
46 views

Posting a JSON array to Sequelize Update query results in a stalled request

I'm using node and a Sequelize (6.37.1) update query and it is stalling continuously. This is the only query with issues. This is a CRUD app where inputs are contextual so I'm using Ajax to post a ...
ron's user avatar
  • 19
-2 votes
0 answers
13 views

TypeError: Class extends value #<Object> is not a constructor or null at Object.<anonymous>

In the backend, when I run npm run watch-dev, i've got error like this, anyone can help me? TypeError: Class extends value # is not a constructor or null at Object. (/home/amar/intern/ocean/ocean/...
Amar Ma'ruf's user avatar
0 votes
0 answers
22 views

Sequelize: Unable to Get Associated Resources in Category Model

I'm working on a project using Sequelize and I have two models, Category and Resource. I defined the relationship between them as Category having many Resources and Resource belonging to Category. ...
Jagdish Padeliya's user avatar
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
0 votes
1 answer
13 views

TypeError: Job.create is not a function

I'm using sequelize in my project, and importing the Job(variable connected to the database) from the models folder, but when I use Job.create it returns this error when inserting data into postman: ...
Antônio Souza's user avatar
0 votes
1 answer
20 views

While trying to login into my Next.js app, getting 500 error, Import trace for requested module

I have setup my Next.js web application in my local system. While trying to login into app, I am getting following error, ie login request POST http://localhost:3000/api/login 500 (Internal Server ...
soccerway's user avatar
  • 11.4k
1 vote
1 answer
17 views

How can we add String Validation Like Enum In Nodejs and Sequelize

type: { type: DataTypes.STRING, defaultValue: "Normal" } In this type I want to add validation Only the Type can be "Normal" Or "Installment" I don't ...
Hiren Kalariya's user avatar
0 votes
0 answers
16 views

Defining hasMany self-associations in sequelize v7

export default class Folder extends Model<InferAttributes<Folder>, InferCreationAttributes<Folder>> { @Attribute(DataTypes.INTEGER) @PrimaryKey @AutoIncrement declare id: ...
Narayan Waraich's user avatar
0 votes
0 answers
30 views

Sequelize - PostgreSQL timezone won't change

I can't use anything else but UTC when reading a Date datatype. Here's my object to be added to PostgreSQL db: { "word": "test", "wordLanguage": "eng", ...
Tolgay Toklar's user avatar
0 votes
1 answer
20 views

Sequelize DatabaseError "missing FROM-clause entry for table" filtering nested include / join

I have double nested include / join of tables. I need to filter first include using second includes column In the end I want to filter users that have no linked items in associated table. I'm using ...
Nickers's user avatar
  • 43
-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
0 answers
33 views

How to fix ER_NO_SUCH_TABLE error when using Model.create with sequelize in MySQL when terminal shows models have been made?

I have read that MySQL does not support autoincrementing values with bulk inserts (bulkCreate() function) so I used a looping create() function instead to test whether it will work that way. NOTE: if ...
RendezYT's user avatar
0 votes
1 answer
33 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

15 30 50 per page
1
2 3 4 5
833