Category "sequelize.js"

Sequelize filter the included tables by where

I am trying to findAll records included nested tables, but did not understand how could I filter included tables by where clause. Here are the words: const play

Sequelize UUID with mySQL: Unable to set default value

I've been trying for awhile to set id (primary key) for my Users table as UUID. However, I keep getting this error: Field 'id' doesn't have a default value, whe

deleting all entries with FK when PK entry is deleted sequelize

I have a post and a notification model. notification has a onPostId FK. When a post is deleted how can I let sequelize know to delete all the notifications that

Accidentially deleted rows from pg_enum

Was looking to drop an enum and did it incorrectly by deleting the rows from the pg_enum table. I should have removed it with this: DROP TYPE IF EXISTS "enum_Or

Sequelize exclude returns different value

So when I query without attribute: exclude... it returns me the correct user, but when I insert that in the query it returns a completly different user. Here is

How to run migrations with dynamic schemas?

I'm using Sequelize (Postgres) and I'm trying to dynamically create schemas and run migrations in them. In other words, I'm not using sequelize.define, because

beforeBulkDestroy not finding model property to change

I am trying to use the beforeBulkDestory Sequelize hook on a user delete that will switch the deleted column boolean to true prior to updating the record to add

How do I make a command in Discord bot in js that insert data in a database with Sequelize?

I'm working on a Discord bot using node.js modules and Sequelize to database, and I want to add a command that users type and the bot registers them in database

Sequilize - Delete ManyToMany Associations

I'm using Sequilize to program a common Student - Course relational database in NodeJS. The 2 Models are associated through the automatically generated relation

Sequelize dialect dependency on msnodesqlv8

We are using sequelize package to connect to mssql server. Our backend code is in javascript. We have a working code like below: const sequelize = new Sequelize

Sequelize with AWS RDS Proxy

I am trying to use the AWS RDS Proxy on my lambda to proxy our database (Aurora MySQL). I wasn't able to find any specific instructions for Sequelize, but it se

GraphQL: TypeError: Cannot read property of undefined

I have an Apollo GraphQL projects where I have created my own Query and Mutations. I have done using mock data and Query and Mutation works fine. But when I am

SequelizeDatabaseError: column User.last_sign_in_at does not exist. Column shows up in PGAdmin

I have recently tried to add the column "last_sign_in_at" to the User table (named "UsersTable" in our db) using sequelize. I've created the migration file and

postgres returns another table column while inserting data in sequelize

When I try to insert new category, I got this error: error: column "image" does not exist sql: 'INSERT INTO "Categories" ("id","createdAt","updatedAt") VALUES

Sequelize js how to get average (aggregate) of associated model

I am trying to get average rating of an associated Model "Rating" of Model "User" using sequelize. sequelize.sync({logging: false}).then(()=>{ return Mode

Sequelize ORDER BY ASC numeric string

please help in this matter. So my scenario is that I have driver app (flutter) that fetch ongoing orders that needed to be delivered. I would like to fetch orde

How to use Haversine formula in Sequelize-typescript to get distance between two coordinates

SELECT id, ( 6371 * ACOS( COS( RADIANS( db_latitude ) ) * COS( RADIANS( $user_latitude ) ) * COS( RADIANS( $user_longitude ) -

How to listen for new records in database with Sequelize?

I have a PostgreSQL database with Sequelize ORM and I want to listen for new entries. How should I do? Should I use Sequelize afterCreate hook? Can someone help

Get number of associated elements in Sequelize

So I have a many-to-many relationship with Sequelize. This code gives me an array of all the categories associated with the Post. It works to get this data. How

PostgreSQL 12.2 with Sequelize 6.3 - UPSERT a array of data and want ON CONFLIT DO UPDATE to merge current existing JSONB and EXCLUDED JSONB

I'm currently using this query to insert or update my array of data when retrieving my list : try { const query = `INSERT INTO "Tables" ("id","tomerge