Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
Create table dynamically using Sequelize

I wanted to ask you if it is even possible to create tables dynamically in NodeJS using Sequelize.js. My goal is to create a simple TODO list where users can create a list (this list should be one table in my database). I have successfully established a connection with my database, created some simple models for my users. I want them to add tasks to their lists. I have also created a POST request route in NodeJS where the creation of the table should be done.

I found a code that can create a table (which it does) but I cannot add any items inside the list because the variable is local and I cannot use it anywhere in the code except the POST request in NodeJS. It still feels like static to me..

app.post('/todo/create', async(req: Request, res: Response): Promise <void> => {
   ....
   let Dummy = sequelize.define('dummy', {
       description: Sequelize.STRING
   });
   ....
}

For example, if I want to use it like I use my user model down below in login POST request

const existsUser = await User.findOne({where: {username: user}});

Any help or good direction would be much appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!