Re:12 requests per second: A realistic look at Python web fr...
by reader_mode on Friday February 19, 2021 @01:29AM
(#26190354)
F# has this + static SQL query string checking at compile time using type providers
Re:12 requests per second: A realistic look at Python web fr...
by PeterisP on Friday February 19, 2021 @09:49AM
(#26193710)
"just generates an object type for a given SQL query's result rows"
For a similar purpose in Python I generally use psycopg with namedtuple resultsets; the namedtuple 'records' do what I need for the returned data and are reasonably efficient.
Re:12 requests per second: A realistic look at Python web fr...
by aabbcc1241 on Sunday February 21, 2021 @01:18AM
(#26211288)
Just hack that for Typescript over this weekend (: https://news.ycombinator.com/item?id=26211286
Re:12 requests per second: A realistic look at Python web fr...
by jtolmar on Monday February 22, 2021 @12:36PM
(#26227393)
Wow, that was fast! I'm impressed.
If you want to keep going forward with it, I'd recommend working on making it clearer what the examples do, and looking at sqlc for Go for inspiration. Of the existing versions of this people replied with, that one had the clearest API, or at least clearest explanation on its landing page.
Re:12 requests per second: A realistic look at Python web fr...
by grosskur on Friday February 19, 2021 @02:17AM
(#26190553)
sqlc can do this: https://sqlc.dev/
I'd love to have a tool that just generates an object type for a given SQL query's result rows, and a function signature for its query parameters.