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?
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