1. 5
    1. 1

      We use this (or a similar) library at $job. I have always been curious about how these sql prefixed strings actually work, and this article didn’t answer that so I finally looked it up.

      For anyone else who didn’t know, tagged template literals allow making custom tagged template strings that are parses by a function. So about what I expected was happening.

      @gajus, great post! Maybe expand a bit on the tagged template part, otherwise this doesn’t seem much different than string substitution at first glance to someone without knowledge of newer js features.

      1. 1
        1. 1

          I think that’s the same article.

          Looking back, I think I wasn’t very clear. While the article was good at explaining different ways on using the sql strings, what wasn’t clear to me was how the sql strings fit into the JavaScript syntax. I had to do a bit of searching to find the MDN page I linked above. So my suggestion was to perhaps add a small bit explaining the sql tagged template literal. To someone like me who isn’t familiar with some of the newer Js features it would be nice to have a reference.