If you want to run SQL, write SQL. The majority of your SQL will not require building dynamic where clauses or (dog forbid) dynamic joins. Having your SQL as plain statements with simple placeholders (to create safe prepared statements) is the saner approach. Not only can you pluck them into your favorite SQL tools and analyzers, but you will not be surprised by terribly performing queries, because you created them d…
1) db.execute("select name, tel from person where id={?}",personId);
2) const sqlText="select name, tel from person where id={?}";
db.execute(sqlText, personId);
3) as 2), but put sqlText in another file,