Replies: 4 comments 1 reply
-
Do you know ts-sql-plugin? It's more efficient (real-time in IDEs), less intrusive than There are other plugins more focused on |
Beta Was this translation helpful? Give feedback.
-
Nice, these look cool. However, couldn't get Even if they were to become more robust, not ideal to have to set up and configure some external tool for this. So I think there is still value in having static analysis built in to Postgres.js out of the box (without having to install any other TypeScript plugins), so that there are no extra setup steps. |
Beta Was this translation helpful? Give feedback.
-
Hi Karl. Is this maybe what you've been looking for? https://twitter.com/CoEliya/status/1564036318229073921 |
Beta Was this translation helpful? Give feedback.
-
It would still be useful to do static analysis to distinguish sql queries from fragments. Right now the returned type of the fragment
is a If the template literal could be parsed unambiguously with https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html, then the fragment can have its own type and can never be confused with a query. |
Beta Was this translation helpful? Give feedback.
-
Hi @porsager ! 👋 Again, thanks for the continued effort on this library by yourself and team, really great!!
One thing that I've seen recently is
squid
, which promises, among other things:This is achieved by leveraging another library by Andy Wermke,
postguard
I wanted to test the waters as to how open the Postgres.js project is to some kind of built-in static analysis of queries, to make sure that queries that get built can also run. I suppose the easiest would be TypeScript here.
cc @Minigugus
Alternatives considered:
One alternative that I've also considered here is to "only" improve the error messaging when things go wrong at runtime with a query: #450
Beta Was this translation helpful? Give feedback.
All reactions