Category "sequelize.js"

How to seed a one file only with sequelize-cli?

sequqlize-cli db:seed:all is working fine, but how to seed only one file? Tried to db:seed:[name-that-i-gave-with-create-command] and db:seed:[full-path-to-seed

MY SQL Sequelize Unique Value not working as intended

I am trying to code a website to work with ReactJS, NodeJs and MySQL. I have been using Sequelize and it works but i realised that it allows all usernames even

TypeError: require(...) is not a function while Using sequalize with node js

I am beginner in web dev and trying to create a Full stack project using Mysql Express React Node js. Facing this TypeError issue while using Sequalize with nod

Node Js sequelize select query by month

Am new in Node Js, In my Node Js project am using sequelize ORM with MySql database. This is my query i want to write select query by month. This is my query

Jest SpyOn choose the correct overload

I do have a class that has 2 overloaded methods. public static create<M extends Model>( this: ModelStatic<M>, values?: M['_creationAttribu

findAll() returns empty with WHERE option

First question on StackOverflow, long time reader first time poster or whatever people say. I'm developing a Discord bot in my free time using Discord.js, and I

Sequelize. SQLite Type checking

I started using Sequelize with SQLite. When I try to insert or update a value, it doesn't check for type-errors. For example I can use string values in a column

Sequelize Migrate Not Recognising Dotenv

I am able to run migrate command when I specify the database name, user and password directly. But when I provide with env variable/value. It says no database s

const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes) - TypeError: require(...) is not a function

I am beginner in web dev and trying to create a project using Mysql, Node.js with Express. Facing this TypeError issue while using Sequalize. Can someone please

How to order by many to many relationship in Sequelize?

I have a many to many relationship between User and Category through UserCategory as below. let user = await User.findAll({ where: { id: req.query.user

Sequelize get data of another column while using Aggregate Function

I'm trying to get data using Sequelize in my Express app and I'm using SQL Server as database. Here is my code: Order.findAll({ attributes:[ [Sequ

why sequelize beforeUpdate hook doesn't work?

I have a simple user model with 2 hooks. User.beforeCreate(setSaltAndPass) User.beforeUpdate(setSaltAndPass) the first works perfectly but the beforeUpdate doe

Sequelize: invalid input syntax for type interval: "undefined"

Whenever i am trying to connect the postgres through the sequelize for insertion/updation/retrieval i am getting following error. Previously it was working fine

Sequelize: invalid input syntax for type interval: "undefined"

Whenever i am trying to connect the postgres through the sequelize for insertion/updation/retrieval i am getting following error. Previously it was working fine

How to delete associated rows with sequelize

I am trying to delete rows associated with a row in a table, without deleting the main row (thus can't use CASCADE). This is the raw PostgreSQL query that does

-bash: sequelize: command not found

I just ran npm install --save sequelize pg pg-hstore in my project root directory and now I am unable to invoke sequelize init. I get the error: -bash: sequeliz

Sequelize - ORM - Associations not working

Using Sequelize with MySQL. I have three models. Consultant, FamilyMember and Appointments. Appointment refers to Consultant and FamilyMember. I have defined th

How can I bind a variable to sequelize literal?

I have this subquery that is used to check the existence of a column related to the source model. const defaultingLoans = await Loan.findAll({ where: {

Sequelize ARRAY Datatype for PostgreSQL

I'm trying to use the ARRAY datatype for Sequelize (Node.js SQL ORM) with PostgreSQL. However I'm not exactly sure how to utilize it. I know how to set it on th

How to use TypeScript with Sequelize

I already have my server application written in Node, PostgreSQL, Sequelize using Fastify. Now I would like to use TypeScript. Can anyone tell me how to begin