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.