Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Intermittent Connection Issues with Sequelize Migrations in Docker Compose Setup [duplicate]

I am using Docker Compose to set up my application, which consists of three services: a MySQL database, a backend API, and a Vue.js frontend. My backend uses Sequelize for database migrations. However,...
Mikhail's user avatar
0 votes
1 answer
24 views

Sequelize create() not working for inserting an order, but manual SQL query works

I am trying to create an order using Sequelize in my Node.js app, but I'm encountering issues with both the Order.create() method and a manual INSERT INTO query. Here is the code I'm using to create ...
Hamzah Alkhateeb's user avatar
0 votes
1 answer
19 views

Can sequelize have self ref column to support a child parent relationship within the same table?

does seauelize support self reference tables? For example, if I have a table called product, and logically, it has child / parent relationships with its self, so I defined a parent_id column that has ...
Tanner Summers's user avatar
0 votes
0 answers
25 views

How to extract actual database error instead of the generic transaction aborted error in Postgresql Sequelize transaction

I am using transaction in my sequelize-typescript for creating a record which looks like this return await this.sequelize.transaction(async (transaction) => { const borrower = await this....
codeinprogress's user avatar
0 votes
0 answers
14 views

Sequelize ORM: Dynamically set database schema for sequelizeInstance (or repositories) at runtime?

For our SaaS API we use schema-based multitenancy, which means every customer (~tenant) has its own separate schema within the same (MySQL) database, without interfering with other customers. Each ...
Sachin Bagewadi's user avatar
0 votes
0 answers
19 views

Problem uploading image from express to s3

I want to upload an image to s3 but cant, eventhough a similar api like that can work normally. exports.createPost = async (req, res) => { const { user_id, title, caption } = req.body;// ...
Chinatsu's user avatar
0 votes
0 answers
24 views

Sequelize Adding Association Causes Always Alter

I am trying to add multiple associations to my project. Although, other tables do not giving this error or misusage effect these associations makes the project always alter. db.option.hasMany(db....
Muhtar's user avatar
  • 1,692
0 votes
0 answers
29 views

Sequelize Multipple Database

I need some help with a problem where I'm trying to create two databases, their tables, and the relationships between them using Sequelize. The issue arises when I attempt to establish a relationship ...
Gilian Erik's user avatar
0 votes
0 answers
20 views

Sequalize associating one model on an RDS database and an Aurora database

I tried to associate a model with 2 different databases that have this same table, one in an aurora db and another in a RDS db using sequalize. They have a different schema name but the same table ...
jSvSL's user avatar
  • 64
0 votes
0 answers
24 views

Sequelizer belongsToMany relations

I am trying to establish a belongsToMany relationship between two models, User and Company. I think I have done everything right, but the funny thing is that the api shows me the results relationships ...
grankan's user avatar
  • 485
1 vote
0 answers
42 views

Please install sqlite3 package manually

I get an npm error from the sequelize module when running the project via node: "start": "node build/scripts/main.js" webpack-internal:///../../node_modules/sequelize/lib/dialects/...
Тимур's user avatar
0 votes
0 answers
20 views

Is posible install old version of adminjs

I'm searching an admin template for an application based on NodeJs+Express+Sequelize. I find Adminjs that seem like very usefull for my purpose, but i read in documentation that is deprecate Js syntax ...
jacklondon's user avatar
-1 votes
0 answers
26 views

SequelizeAccessDeniedError: Access denied for user 'root'@'localhost' (using password: YES)

I am encountering the following error when attempting to connect to my MySQL database using Sequelize and credentials extracted from a .env file: SequelizeAccessDeniedError: Access denied for user '...
vaibhav's user avatar
1 vote
0 answers
18 views

Error Occurs When Configuring Passport Session Store in Express.js with Sequelize and PostgreSQL

I am using Passport for authentication in my Express.js project. The database and ORM I am using are PostgreSQL and Sequelize, respectively. While configuring session.use() for session handling, I ...
Minh Nguyễn's user avatar
1 vote
0 answers
20 views

Sequelize associations with multi-tenant (schemas) solution

I'm rather new to backend development, so bear with me. I have a 'partners' table in the 'public' schema and each partner has their own schema like 'partner_1', 'partner_2', etc... Their schemas ...
Tom's user avatar
  • 11
1 vote
0 answers
16 views

SequelizeAssociationError: Conflict in defining HasMany and BelongsTo relationships between User and Friends models

I am trying to define a HasMany and BelongsTo relationship between my User and Friends models in Sequelize. However, I am encountering the following error when I start my server: AssociationError [...
bvmbo's user avatar
  • 11
0 votes
0 answers
25 views

Using Sequelize to define a 1:m relationship between two models (+ creating migrations)

I am confused on the intended workflow with Sequelize. I have found some documentation that refers to a workflow that uses sequelize-cli, while others seem to create bespoke one-off javascript scripts ...
sherrellbc's user avatar
  • 4,831
-1 votes
0 answers
32 views

NextJS 15, Auth, Sequelize, Database

I have been struggling with getting the authentication and authorization with credentials using sequelize and a local database up and running. Not using any social providers. Not sure if the sequelize ...
Fred19's user avatar
  • 19
0 votes
1 answer
36 views

Sequelize Error: Restaurant.belongsTo called with something that's not a subclass of Sequelize.Model when importing Order model

I recently added a new model called Order to my project and successfully migrated it. However, the system does not seem to recognize it as a model. When I import it into my index.js file, it doesn't ...
Hamzah Alkhateeb's user avatar
0 votes
0 answers
13 views

Sequalize Update a column on soft delete

in paranoid table, Can I merge these two queries into one await activeSubscription.update({ subscriptionStatus: constants.SUBSCRIPTION_STATUS.CANCELLED }); await activeSubscription.destroy()...
Abhinav Kulshreshtha's user avatar
-1 votes
1 answer
38 views

Getting ERR_MODULE_NOT_FOUND in my Heroku App but working fine in localhost

Thanks for being here. My stack Postgres Node 20.17.0 Express Sequelize ORM Javascript When started happening? This started happening after migrating my app from the 'require' to 'import' syntax. I ...
Benjamín Cáceres Ramirez's user avatar
0 votes
0 answers
18 views

Documentation about Sequelize ignoring unknown attributes

I asked ChatGPT whether Sequelize update or create will ignore extra attributes passed to it. I have this code and unknownField is indeed ignored. The data does not cause a db error. const data = { ...
duduwe's user avatar
  • 1,240
0 votes
1 answer
19 views

Sequelize Grouping by Associations with aliases (model->model2 AS 'alias')

I am having a problem with grouping by associated models that are using aliases. The table on the client side has grouping, ordering, pivoting etc. Most of it I have down, but the grouping is causing ...
Zarasmus's user avatar
0 votes
0 answers
23 views

Sequlize - Combine array contains operator with iLike

Following the example from here - https://sequelize.org/docs/v7/querying/operators/#array-contains-operator Post.findAll({ where: { tags: { [Op.contains]: ['popular', 'trending'] }, }, }); ...
URL87's user avatar
  • 11k
0 votes
1 answer
46 views

How to Query Bookmarked Posts Instead of Authored Posts in Sequelize

I’m new to Sequelize, so I apologize if my question seems basic. I have defined two models in my Sequelize setup: Post and User. I’m trying to query both the posts a user has authored and the posts ...
Abolfazl Mashhadi's user avatar
0 votes
0 answers
31 views

Problem building query sequelize-typescript

I am currently facing an issue when creating a query with sequelize-typescript. The problem arises when trying to fetch records from a many-to-many relationship. Here is the SQL query I am trying to ...
Sebastian Narvaez's user avatar
0 votes
0 answers
25 views

How to avoid the "Unknown column" error in Sequelize (MySQL)

How to avoid the "Unknown column" error in Sequelize (MySQL) when a field is missing in the database and return NULL instead of an error in production? I am working with Sequelize and MySQL, ...
Sergei Illarionov's user avatar
0 votes
0 answers
27 views

In nodejs (sequelize), Add new key or column in MySql via migration

In nodejs (sequelize) ,Add new key or column in MySql via migration but it is not defined in the model so how it update automatically in the model I have make new migration on adding new column and ...
Deepak Pradhan's user avatar
0 votes
0 answers
23 views

node js Sequelize one to many single create[Solved]

Is there anything wrong with the way the code is wrote? Because using one-tone I can insert the data normally, but when use one to many, the data is just ignored. The idea is: Contact Model can have ...
Maciel Rogerio's user avatar
2 votes
1 answer
28 views

Sequelize TypeScript Error: "Property '[OpTypes.and]' does not exist on type 'WhereAttributeHash<any>'"

I'm trying to dynamically build a WHERE clause using Sequelize in a TypeScript application, but I am encountering a typing error when attempting to use [Op.and] within WhereOptions. Specifically, ...
kaffeetasse's user avatar
0 votes
0 answers
22 views

Sequellize app.post show Error saving QR history: TypeError: Cannot read properties of undefined (reading 'apply')

I would like to make a post request, to save my built QR Code that I test my route to Postman. Ok,it works my QR code is saved into my database but it show this error message Error creating QR history:...
user28176721's user avatar
0 votes
0 answers
32 views

Generating parameterized SQL statements with Sequelize for SQL Server

I am working with Sequelize on a SQL Server database, and I'm encountering some challenges with how Sequelize generates SQL statements for querying. Question: is there any way to configure Sequelize ...
Kamal Varadarajulu's user avatar
0 votes
0 answers
26 views

Squelize Sort By Included Model

I'm struggling to sort cases by the patients first name. I've tried nearly every possibility I feel like I could and still nothing. For some reason, it's changing the column name and then it can't ...
LUKER's user avatar
  • 536
0 votes
1 answer
25 views

Sequelize Alias mismatch

## Product Model ## module.exports = (sequelize, DataTypes) => { const Product = sequelize.define('Product', { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement:...
Fahid Shadman's user avatar
1 vote
1 answer
54 views

Sequelize transactions are very slow

I'm using sequelize with node to make a simple update endpoint that will make a couple of queries: const update = async (req: any, res: any, next: any) => { const t = await db.sequelize....
Giulio Pretis's user avatar
0 votes
1 answer
119 views

Unable to order based on joined table with Many to Many relationship

I'm trying to order a set of paged results based on the existence of many to many relationship. I can write a query by hand that does this, but I'm trying to figure out how to do this the sequelize ...
acolchagoff's user avatar
  • 1,968
0 votes
1 answer
39 views

Sequelize: User is not associated to Commentaire

I am working with two Sequelize models: User and Comment. Each Comment belongs to a User, and a User can write multiple comments. My goal is to include all comments associated with each user in my ...
iyed ghodhbane's user avatar
0 votes
1 answer
25 views

Is Sequelize Truncating the JSON Response with Nested Relations?

If you look at the productPGs and variantPGs relationships you notice the keys are cutoff or truncated, why is that happening? This only happens when I use include: { all: true, nested: true } in the ...
Chris's user avatar
  • 5,063
0 votes
0 answers
14 views

How to resolve TypeScript error when using generic return types with Sequelize Models

I'm working with sequelize-typescript and trying to create a generic function that returns specific model instances based on the provided model class. My setup looks like this: import { Model, ...
Faizan's user avatar
  • 1
0 votes
0 answers
59 views

Sequelize sync SQL Server database

I have a question regarding the sync method in Sequelize with SQL Server. To summarize the problem: I have a model with a unique column, and when the table doesn't exist or the database is empty, the ...
oox's user avatar
  • 19
1 vote
0 answers
80 views

Sequelize and SQL Server

I am building a React app with Node.js and Sequelize with SQL Server. I am running into the below error. I am using the v7 alpha version of Sequelize. My model is below: import { Sequelize, DataTypes, ...
MichaelB's user avatar
0 votes
1 answer
67 views

Sequelize COUNT() with HAVING clause not aliasing properly in SQL query

I need to find users with all the appropriate tags on a one to many relationship (one user to many tags) My code: const tags = [10,15,20]; const users = await User.findAll({ attributes: ['UserModel....
acolchagoff's user avatar
  • 1,968
0 votes
1 answer
28 views

Sequelize with typescript defining associations

For the past three days, I've been trying to integrate Sequelize M:N (many-to-many) associations with TypeScript. The issue arises when I follow the official Sequelize documentation, which suggests ...
Andrew Prudnikov's user avatar
0 votes
0 answers
28 views

Sequelize Error: "Dialect needs to be explicitly supplied as of v4.0.0" when using config.ts with dotenv-flow

I'm working on a Node.js project with TypeScript, Sequelize, and PostgreSQL. I encountered the following error when running my application: ERROR: Dialect needs to be explicitly supplied as of v4.0.0 ...
amit12k's user avatar
0 votes
0 answers
29 views

Sequelize many-to-many relation query search very slow

I use nodejs, mysql and sequelize. I have 3 model: Post , Tags and PostToTags. I add many-to-many relation between Post and Tags. Post model have title, content attributes. Tags model have title and ...
bego's user avatar
  • 23
1 vote
0 answers
25 views

how arrange every attributes in a parent level attributes array

const allItems = await findAndPaginate(CartItems, req.query, { attributes: [ ["cart_items_id", "cartId"], ["cart_item_mrp", &...
suhail kv's user avatar
0 votes
1 answer
15 views

Sequelize Many-to-Many on same table

I have a user: @Table({ underscored: true, }) export default class User extends Model { @PrimaryKey @Column id: string; @AllowNull(false) @Column name: string; @...
shaharsol's user avatar
  • 1,001
0 votes
1 answer
24 views

I want to Find data in Sequelize that createdAt and UpdateAt same Consider only date Not date time

const StudentAssessmentTransaction = sequelize.define( "studentAssessmentTransaction", { id: { type: DataTypes.INTEGER, allowNull: false, ...
Hiren Kalariya's user avatar
0 votes
0 answers
13 views

How to search substring inside array of string sequelize? [duplicate]

I use sequelize and mysql. Here question. For example I hava column name: DataTypes.JSON . for example i have these data: [ {id:1, name:['mother','adad','asd',...],... }, {id:2, name:['sister','as',..]...
bego's user avatar
  • 23
0 votes
0 answers
36 views

Always Encrypted SQL Server with Sequelize

I'm testing to encrypt some data using always encrypted, but I'm having problems with comparison queries. Sequelize: mapDatabases.forEach(async (row) => { let model = row.model let ...
Lucas Mateus's user avatar

1
2 3 4 5
251