Is there a way of not hard coding sql queries in my express app? : <p>So I am making an express app for a project and I am using mysql as the db, I had previously hard coded my sql queries in my code, but it is bad practice to do so according to my teacher, so I was looking for a way in which I don't have to hard code.  </p>

<p>I have tried queries like find and findAll using mongoose, I am looking for something similar.</p>

<pre><code>app.get("/shops/:id",function(req,res){
    var id = req.params.id;

    connection.query('SELECT * FROM `menuItems` WHERE shop_id =?',[id],function(error,results,fields) {
        console.log(results);
        res.json(JSON.stringify(results));
    })
});
</code></pre>

<p>I don't want to hard code my queries as I have in the above code snippet.</p>

<p>Kindly help me get a way for not hard coding sql queries in my app. Thanks in advance.</p>
