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

225
Vistas
How to wrap long sql statement in node js

I have a large mysql select query (Over 100 lines) that I need to run in a node.js app. The fields in my sql statement use backticks ` so I'm not sure if I can use ES6's multi-line string feature. Is there any other method I can use to wrap my sql query without having to concatenate each line?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I would suggest saving the long SQL to a .sql file (and keep under version control), and then reading it into a variable once on load.

This way you can also format or beautify the SQL even more.

But, adding to another comment before, long SQLs are heavy on the SQL parser so either use Prepared Statements (if available on your DB engine), Stored Procedures or even a View

over 4 years ago · Santiago Trujillo Denunciar
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