question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prepared Statements and Tagged templates

See original GitHub issue

It would be really cool if you supported tagged templates for prepared statements instead of @param syntax. It’s more modern and easier to work with in newer versions of node.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
dhensbycommented, Feb 13, 2019

this was implemented some time ago

0reactions
benjamingrcommented, Apr 11, 2016

That could work for making the statement, but it would not give you a “safe easy default” where using a prepared statement is the easiest way to run your code and even people who are not very informed don’t run into SQL Injection

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generating SQL prepared statements with Javascript tagged ...
I have put together some code to generate SQL prepared statements const sql = (string, ...values) => { const isQuery = query =>...
Read more >
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, ... However, a tagged template literal may not result in a string; ...
Read more >
Tagged - npm.io
Tagged Packages ; common-tags. a few common utility template tags for ES2015. array ; sql-template-strings. ES6 tagged template strings for prepared statements ......
Read more >
8. Template literals - Exploring JS
Escaping in tagged template literals: cooked versus raw; 8.4.3. Example: String.raw; 8.4.4. Example: implementing a tag function for HTML templating; 8.4.5.
Read more >
keywords:tagged template - npm search
ES6 tagged template strings for prepared statements with mysql and postgres ... a few common utility template tags for ES2015.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found