Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
1 replies
77 views

I am working on a university project using Node.js, TypeScript, and Sequelize. I've implemented a Repository layer to decouple my database logic from the Service layer. Initially, my repository was ...
raffaele avallone's user avatar
Advice
1 vote
0 replies
54 views

I'm working with Sequelize v6, and facing a circular dependency between two models: User and Profile. To solve this, I am setting constraints: false in one association and then manually adding the ...
Nhut Minh's user avatar
0 votes
1 answer
138 views

I am building a RAG application using Node.js, Sequelize, and PostgreSQL with the pgvector extension. I have successfully enabled the vector extension in my database. I am now trying to create a ...
Mohammed Hassan's user avatar
1 vote
2 answers
195 views

I'm facing an issue with Sequelize(postgres) transactions in a high-traffic Node.js/Express app. I have a flow like this: async function createPayment(data, trnx) { // Save in DB within transaction ...
Tahseen Rasheed's user avatar
3 votes
1 answer
118 views

So, I'm trying to learn full stack by making a list app, and I'm using Sequelize.js for the database. So far I've got User and List models. I recently switched to Sequelize v7.0.0-alpha.47. I can't ...
MaxCodes's user avatar
  • 108
1 vote
0 answers
67 views

I am use Sequelize with Postgree in a Serveless project. I just try to get an array of +600 objects from API and I need to send to DB. I use a map() for that array and I use sequelize upsert() or ...
Bryan's user avatar
  • 11
0 votes
0 answers
44 views

I´m trying to establish a follow list to from user to user: class Follower extends Model<InferAttributes<Follower>, InferCreationAttributes<Follower>> { @Attribute(DataTypes.UUID) ...
Kirillos coding's user avatar
-1 votes
2 answers
62 views

I'm trying to integrate sequelize with the db conection to postgres and i am getting an error where relationships are built. i don't know if i'm missing something at this point index.js 'use strict'; ...
o.go's user avatar
  • 1
0 votes
0 answers
62 views

I want to update multiple records ( more than 100 ) and for this I am trying to use bulkCreate method of sequelize with following parameters: const updatedUsers = await User.bulkCreate(allUserInfo, { ...
JayantSeth's user avatar
1 vote
0 answers
34 views

My sequelize-cli is npx sequelize-cli model:generate --name Profile --attributes username:string,imageUrl:string,fullname:string,dateOfBirth:date,UserId:UUID,role:enum:'{staff,admin}':defaultValue:...
flyingduck92's user avatar
  • 1,692
0 votes
0 answers
64 views

In Sequelize, I've the following schema: const User = sequelize.define('User', { name: DataTypes.STRING, email: DataTypes.STRING, }) But in TS, User ends up being typed as ModelCtor<Model<...
Joy's user avatar
  • 103
0 votes
0 answers
28 views

I have a Sequelize model that has a property that is also a model. In this case, Category has a property ParentCategory that is an optional model of Category. When I get the "non model" ...
CmdrShepardsPie's user avatar
0 votes
0 answers
15 views

I have a frontend web project A with dependencies B, the dependencies B using sequelize that only work in node with server side. So I tried to exlclude sequelize https://sequelize.org/ in project A ...
Dolphin's user avatar
  • 41.2k
1 vote
1 answer
365 views

I've been trying to set-up a working Electron application using Electron Forge with Sqlite3 and Sequelize. This has worked great up until where I need to actually build and package, and distribute the ...
Scott Mckay's user avatar
-3 votes
1 answer
149 views

I maintain a Node.js (v14.x) + Express + Sequelize (v6.x) application and use Snyk Code to catch security issues in our CI pipeline. We rely heavily on Sequelize’s parameter binding (:param) to ...
Raymond M. Roberts's user avatar
1 vote
1 answer
89 views

I'm using the sequelize-cursor-pagination package to implement pagination in my Node-Postgres application. I need to order my results based on a field from an included (associated) model, but the ...
droid's user avatar
  • 78
-1 votes
1 answer
77 views

I have been scratching my head for a while now trying to figure out how to exclude unnecessary database dialect adapters. For context, I am building an app with Vite. Its using ElectronJs and ...
Sukanta's user avatar
  • 105
0 votes
1 answer
49 views

I'm making a query to Articles table to get the article data with publisher, tags, images and categories. The relation between publisher and article is M:1, between tags and articles N:M, between ...
Osama Assi's user avatar
0 votes
1 answer
38 views

I am creating a node API connecting to a mySql db using Sequelize. I want users of the API to be able to specify which models to include in the results of a query. For example I have a model like this:...
Brian's user avatar
  • 1,547
0 votes
0 answers
45 views

In sequelize documentation, it is stated in association alias section Aliases are especially useful when you need to define two different associations between the same models. For example, if we have ...
polar's user avatar
  • 1
1 vote
0 answers
80 views

I'm having issues running RDS sequelize queries. I'm using EC2 Node.js original: error: no pg_hba.conf entry for host "172.31.8.1", user "postgres", database NAME, no encryption 5|...
Yuki Chan's user avatar
1 vote
0 answers
48 views

I'm learning sequelize + other stuff and I'm using sequelize-cli to initialize the sequelize and generate the models. When I try to use the model in other file it doesn't suggest anything related to ...
Hid's user avatar
  • 19
1 vote
1 answer
132 views

I'm in the process of migrating a Javascript project to Typescript. One of the steps is to migrate the sequelize models. I'm following the instructions located at: https://sequelize.org/docs/v6/other-...
lordoku's user avatar
  • 1,262
0 votes
0 answers
31 views

I would like to know how to correctly use useMaster with graphql-sequelize. I'm trying to force the query to go to the master database using this code: before: (findOptions) => { const ...
Anderson Vendruscolo's user avatar
1 vote
1 answer
43 views

Sequelize's createXXXXX method doesn't seem to be adding the necessary foreign key. This running the following code for these two models gives me a "notNull Violation: Seat.office_id cannot be ...
hobberwickey's user avatar
  • 6,474
0 votes
1 answer
57 views

I don't want to eagerly load all the associated data, it won't be used. But, I might want to know that related records exist, for example to link to related records. So I'm trying to set up an ...
Randy Hall's user avatar
  • 8,367
0 votes
0 answers
40 views

Here is the full code: const StockTypes = require('./stock_types'); module.exports = (sequelize, DataTypes) => { const Stock = sequelize.define('Stock', { name: { type: DataTypes....
Serkan's user avatar
  • 81
0 votes
0 answers
38 views

Trying to establish a connection to my local PostgreSQL database via Sequelize. I have no trouble accessing it with pgAdmin, using postgres as the user and no password. I am passing this into the ...
Randy Hall's user avatar
  • 8,367
2 votes
1 answer
299 views

I’m currently working on a project where we are using PostgreSQL with Sequelize to perform complex queries involving multiple nested include relationships. However, we’ve encountered an issue related ...
Dip Patel's user avatar
0 votes
0 answers
52 views

await sequelize.sync({ alter: false, force: false }); My expectation and also as per the sequelize documentation this will only create the new tables if not present, it will not run any alter query. ...
Shubham Singh's user avatar
1 vote
1 answer
57 views

I have 2 rows in the database table moneys. Using Sequelize, I want to select all rows from the table. The following raw query in DBeaver MySQL client returns all the results. So, that works as it ...
kkamara's user avatar
  • 41
0 votes
0 answers
139 views

Product Model import { DataTypes } from "sequelize"; import sequelize from "../util/database.js"; const Product = sequelize.define("product", { id: { type: ...
Sezer Emer's user avatar
0 votes
1 answer
80 views

I'm using type module/import syntax for the rest of my project, but the Sequelize CLI generates files with require syntax. How should I handle this? I'm already having trouble with not being able to ...
t t's user avatar
  • 1
0 votes
1 answer
279 views

I've been using Sequelize (6.37.X) on a small side-project for a while. Just a day or so ago, I started having failures in my unit tests, and I'm seeing a lot of this warning on the console: (...
rjray's user avatar
  • 6,951
0 votes
0 answers
66 views

I'm using Sequelize v6.37.5 with PostgreSQL in a multi-tenant architecture, where each tenant has its own schema. Models are defined once globally, and we use .schema(schemaName) to access tenant-...
DIGVIJAY SINH CHAUHAN's user avatar
1 vote
1 answer
110 views

I'm working on a Node.js backend project and have run into a strange issue involving MySQL connections. Here's the situation: I am using a MySQL database hosted on Digital Ocean (Managed MySQL ...
Rawand ofj's user avatar
0 votes
1 answer
77 views

So I'm trying to create a user for my task management app, I'm using Express.js, Sequelize ORM for PostGres and Apollo/Server for graphql. Creating a user works fine, but when I try to login using ...
Edens Fallen Leaf's user avatar
0 votes
0 answers
54 views

Consider these models and the Listing post route. I fetch the body data in the request. router.post("/", async (req, res, next) => { const { address: addressData, building: ...
IgorArnaut's user avatar
1 vote
1 answer
84 views

I have a Vue 3 app hosted on Netlify, and the backend is hosted on Heroku. The login is a simple /login endpoint made with Express and Sequelize. It works well on desktop, but when I try to log in on ...
Luis's user avatar
  • 9
0 votes
2 answers
46 views

I try count foreign table rows with Sequelize this.publicationModel.findAll({ attributes: { include: [ [Sequelize.cast(Sequelize.fn('COUNT', 'comments.id'), 'int' ), '...
Алексей Смирнов's user avatar
0 votes
1 answer
93 views

I have a table named Expenses and the table has a column named expenseEditHistory. The column is of JSONB type. I am using sequelize to manage the database (postgres). Structure for expenseEditHistory ...
SaaD Ibne Jamal's user avatar
0 votes
2 answers
200 views

I'm learning Nest.js, I'm trying to connect via SequelizeModule to my local postgres database, but I keep getting this error Error when starting start:dev [20:41:14] Starting compilation in watch mode....
ralph's user avatar
  • 3
0 votes
1 answer
60 views

I’m working on a Node.js project using Sequelize with MySQL. The database connection is established successfully, and sequelize.sync({ alter: true }) runs without errors, but my users table is not ...
Marcocholla01's user avatar
0 votes
1 answer
91 views

I am trying to sync a Sequelize model with my database, but I can't get over this error. Using Sequelize as my ORM, database is Oracle express:21.3.0-xe This is the error: Executing (default): ...
Diana's user avatar
  • 1
0 votes
0 answers
37 views

Postgres, Sequelize, Node.js environment. Model.create function success at creation and return dataValues, however when I check in db, it's never been added. What's happening behind create or is this ...
crossorigin's user avatar
1 vote
2 answers
128 views

I'm working on a Node.js backend using Express and Sequelize to connect to a PostgreSQL database. However, when I run node index.js, I get a SequelizeConnectionRefusedError. My index.js file: import ...
Sourabh Singh Bais's user avatar
0 votes
0 answers
24 views

I wrote following sequelize query const result = await VendorCompany.findAll({ attributes: [ "id", [Sequelize.fn("COUNT", Sequelize.col("Vendor->...
Abhishek Kumar's user avatar
0 votes
1 answer
16 views

I use the following function in an API I am building const editUserInfo = catchAsync(async(req, res, next) => { const userId = req.user.id; const body = req.body; const result = await ...
Logan Goswick's user avatar
0 votes
0 answers
55 views

I am using Sequelize with Node for my backend. One of my tables is probably going to grow a lot in the coming weeks (at this moment, the table is around 1-2M rows). I added 30M lines and added the ...
Jean-Loup's user avatar
  • 396
1 vote
1 answer
58 views

I am implementing a social network where a User can follow another user. So I have a Follow model: export default class Follow extends Model { @PrimaryKey @ForeignKey(() => User) @...
shaharsol's user avatar
  • 1,032

1
2 3 4 5
248