Pretty interesting, but it doesn't seem to be possible to use the resulting values? Except as type declarations of course. Also, the playground link either fails (there are several errors) or doesn't produce any output.
The errors aren't really errors, just warnings about unused types
const sql = 'SELECT ...';
type SQL = typeof sql;
// type SQL = "SELECT ..."