5 ms·
I'm not entirely sure, but I suspect it's one of these programming "joke" where you take a concept and bring it far enough that it becomes ridiculous. So I'm g
by alex_duf 6y ago
I'm not entirely sure, but I suspect it's one of these programming "joke" where you take a concept and bring it far enough that it becomes ridiculous.
So I'm guessing there's no real practical use case for this, and is a nice flex from the author.
It would be nice if that were made dead clear in the Readme, something like "Why? Because it's fun"
- gfody 6y agostrong typing for arbitrary sql queries is actually really nice and this is much better than stuff like sequelize or typeorm which seem sadistic in comparison
- nsonha 6y agogenerating types from a swagger spec? Graphql? Or any kind of schema? Look up fsharp type providers.
- alex_duf 6y agoAs far as I understand (and I might be wrong so please correct me), this can't be used to generate anything. Of course all the technologies you've listed are useful and brilliant but this isn't what I'm seeing. It's more of an experiment of thoughts to generate types that are defined by the result of the SQL query, bending a compiler to a new strange behaviour that happens to be SQL like.
- nsonha 6y agoIt definitely can parse anything, the code that is required to make such a parser might be a bit unreadable but look up somewhere in this thread there is a twitter link to a github project of a generic json parser. Typescript 4.1 isn't event released yet, once it is there will be a dozen of projects like this. If you think this is useless because it doesn't generate any code then I'm assuming you're not familiar with typescript because type level libraries isn't supposed to do do that anyway. There are already libraries that generate open api client and graphql client but they generate type definition via an extra build step which libraries like this can eliminate. And this typescript feature was made to parse strings so no this is not "bending the compiler"