Re:Go performance from version 1.2 to 1.18
by maattdd on Friday February 04, 2022 @03:05AM
(#30204080)
Typesafe SQL, typesafe template (or just useful template, not the ones in the stdlib which sucks tremendously), model metaprogramming, etc...
[ Parent
| on HN ]
Re:Go performance from version 1.2 to 1.18
by Cthulhu_ on Friday February 04, 2022 @07:59AM
(#30206230)
Do you have any examples of other languages offering typesafe SQL integrations? Not sure what to think of it, given how you'd end up having to map SQL datatypes (across multiple database engines) with Go's own (not very powerful) types or a custom type validation layer (which already moves the problem to runtime instead of compile-time).
I did see a post the other day criticizing Go's standard template language and approach. Maybe someday someone will stand up and build an alternative, more advanced template engine - it can just be a library, after all.
Re:Go performance from version 1.2 to 1.18
by maattdd on Friday February 04, 2022 @10:18AM
(#30207807)
In Rust: https://github.com/launchbadge/sqlx
In Haskell: https://hackage.haskell.org/package/esqueleto
Either it analyzes the given SQL to determine the in/out types of each SQL query, or it calls the database describe feature at compile-time.
Re:Go performance from version 1.2 to 1.18
by alecthomas on Friday February 04, 2022 @03:42AM
(#30204331)
FWIW for SQL, sqlc[1] is probably the nicest SQL layer I've used in any language.
Re:Go performance from version 1.2 to 1.18
by rawoke083600 on Friday February 04, 2022 @04:54AM
(#30204788)
Really, really wanted to use it a few days ago.. but not sure if it's a mysql8 issue but seems most of my "very simple" table definitions couldn't be parsed :/
Looking at the github there seems to a lot of "parsing problems" for the schema files :(