node-sql-template-strings icon indicating copy to clipboard operation
node-sql-template-strings copied to clipboard

feat: Add 'concat' method as immutable alternative to 'append'

Open cassiozen opened this issue 7 years ago β€’ 2 comments

Useful for reusing a base query with multiple different appended statements:

Example:

const baseQuery = SQL`SELECT * FROM books`;

app.get("/", (req, res) => {
  const query = baseQuery.concat(SQL` WHERE id = ${req.params.id}`);
  // Some response
});

References #71

cassiozen avatar Jan 10 '18 19:01 cassiozen

Codecov Report

Merging #72 into master will not change coverage. The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #72   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          35     47   +12     
  Branches        6      9    +3     
=====================================
+ Hits           35     47   +12
Impacted Files Coverage Ξ”
index.js 100% <100%> (ΓΈ) :arrow_up:

codecov[bot] avatar Jan 10 '18 19:01 codecov[bot]

May I suggest alternative solution https://github.com/felixfbecker/node-sql-template-strings/pull/79

skyjur avatar Apr 29 '18 18:04 skyjur