Hacker News new | ask | show | jobs
by StefanWestfal 1150 days ago
Nice to see ongoing development and a view ahead.

For work I would need a good interface for SQL. In pet projects I am using sqlx for Rust and sqlc for Python. In both you can write SQL directly and get query validation and parsing into struct / PyDantic for free. Is there something like this for Deno?

2 comments

I was interested in looking up sqlc for python but it seems to be for go? Is there a different version than this? https://github.com/kyleconroy/sqlc
They appear to have beta grade[0] support for Python and Kotlin. (TypeScript on the roadmap as well)

[0]: https://docs.sqlc.dev/en/latest/reference/language-support.h...

They put some work into the Python adoption and it is enough for smaller projects but I did not try it for to complex use cases. You can see it under examples. What is nice is that you can set the option to parse into PyDantic rather the dataclasses.
There's pgtyped, which I believe does almost the same as sqlc

https://github.com/adelsz/pgtyped