News for hackers. Stuff that matters.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by CoffeeDregs on Thursday September 03, 2020 @10:08AM (#24364189)

   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...

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by exevp on Thursday September 03, 2020 @10:13AM (#24364240)
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.

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by lucideer on Thursday September 03, 2020 @10:13AM (#24364238)
Tagged templates are a core feature of JS, not just of TS

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

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by marton78 on Thursday September 03, 2020 @10:51AM (#24364592)
This is nothing special, it's commonly used e.g. with GraphQL (the `gql` tag).