Ask HN: Which programming language do you think offers the best support for SQL?
1–10 of 10 posts
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#2You may be interested in https://hasura.io
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#3I worked with several operating systems that included a native programming language and a built-in DBMS: DEC-MUMPS (MUMPS) and IBM OS/400 (RPG). The facilities for database queries in these languages were much better than embedded SQL.
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#4For node we use the pg-format package to format most of our queries and then the standard pg package to execute queries. It is honestly one of the easier and cleaner ways methods I've used. I am not a big fan of ORM's and find a lot of them add way to much complexity for too little benefit, so I am a big fan of either stored procedures/functions or straight (but safe) query building.
I have written code in node.js, Go, C & C++, Java and Python to manipulate data in different sql databases and they all have some form of tedious tasks in relation to the SQL integration.
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#5I've never encountered great database mapping. I like .NET's type-safe query builder, but it's still very limited once you get beyond the absolute basics. You may be interested in https://hasura.io
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#6Honestly I've never found a programming language where SQL didn't have some tedious tasks. There are always lots of little edge cases and error handling etc that never seems to be fully covered by the libraries. That said, for a CRUD type app, I usually default to node.js unless the requirements would exclude it for some reason, then I'd move to Go, but generally I avoid writing new Java anymore, not that I think Jav…
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#7I've never encountered great database mapping. I like .NET's type-safe query builder, but it's still very limited once you get beyond the absolute basics. You may be interested in https://hasura.io
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#8Great question. General-purpose programming languages and query languages have entirely different objectives and don't mix well. In practice, SQL is a high-level messaging protocol used to communicate between two processes (client server) or two modules within a single process (client embedded DBMS). I worked with several operating systems that included a native programming language and a built-in DBMS: DEC-MUMPS (MU…
Re: Ask HN: Which programming language do you think offers the best support for SQL?
#9Re: Ask HN: Which programming language do you think offers the best support for SQL?
#10Honestly I've never found a programming language where SQL didn't have some tedious tasks. There are always lots of little edge cases and error handling etc that never seems to be fully covered by the libraries. That said, for a CRUD type app, I usually default to node.js unless the requirements would exclude it for some reason, then I'd move to Go, but generally I avoid writing new Java anymore, not that I think Jav…
I also try to avoid ORM's but ditching them makes mapping to struct/objects cumbersome. How you deal with mapping joins in Go and node.js?
When I do need the data in object form I use what is probably an unpopular method for a lot of people, that is I build a serialize/deserialize solution (or use one already built). It isn't hard in either node.js or Go. It can add some fragility into the codebase, however, depending how it is implemented. Frankly though, I like this because essentially this is what an ORM would do too, just an ORM would be trying to build the query, guess on keys, indexes etc and then still serialize and deserialize my data, which again may not be ideal because of generic choices it has to make.
Also, a fairly common pattern for CRUD APIs is I do not need to map the returned data into an object ever, I simply need a json object to return. And at least when using postgres I can use jsonb_agg and to_jsonb to help make life really easy. MySQL has similar json functions. When doing updates the submitted json data is used to build the query so there is no need to really have things in native object form.
Hopefully that all makes sense.