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
12,490
questions
-1
votes
0
answers
9
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/...
0
votes
0
answers
21
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. ...
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;
....
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:
...
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 ...
1
vote
1
answer
16
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 ...
0
votes
0
answers
15
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: ...
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",
...
0
votes
1
answer
19
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 ...
-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
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 ...
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 ...
2
votes
2
answers
50
views
Why am I getting error: no pg_hba.conf while connecting nodejs application to aws rds Postgres?
I have created an instance of RDS Postgres on database. I am trying to use it in my nodejs application as remote database. The things require to make connection to db include endpoint, username, ...
0
votes
0
answers
46
views
How to query two Sequelize models through a junction table? Sequelize throwing error on 'through: model'
I am writing a webapp for practice. I have several sequelize models, and querying the db through them so far has been no issue. However, when I tried to use a junction table to return what would be a ...