Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

238
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda