Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

   sql"SOME SQL";
This looks to be a "tagged template": https://basarat.gitbook.io/typescript/future-javascript/temp.... I'm a TS user but hadn't seen that feature before. AFAICT, the library is using a side-side-side-feature (tagged templates) of TS as the core abstraction [1]. Impressive. Might be a little brittle in the face of significant SQL or query composition?

Anyhow, I'm a heavier-ORM user but that's impressive.

--- [1] https://github.com/Seb-C/kiss-orm/blob/c4b6c9ad2f81337938a9c...



Not specific to TS, just one of the modern JS features: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Scroll down to the part explaining how to use custom tags.


Tagged templates are a core feature of JS, not just of TS

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


This is nothing special, it's commonly used e.g. with GraphQL (the `gql` tag).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: