How many people are actually using raw SQL on the backend? I thought people got tired of maintaining strings of raw SQL and migrated to query builders or ORMs. > I usually end up with a bunch of Lodash (groupBy, filter, map, reduce) to shape the data I get from the server. I mean, we are also doing the same thing with ORMs on the backend.
Don’t we all just want to use SQL on the front end?
71–80 of 184 posts
Re: Don’t we all just want to use SQL on the front end?
#72Re: Don’t we all just want to use SQL on the front end?
#73Re: Don’t we all just want to use SQL on the front end?
#74A tweet storm: https://twitter.com/jlongster/status/1341586372252078083
A blog post which mentions some of how it works: https://actualbudget.com/blog/porting-local-app-web
A more recent tech talk (which I haven't watched): https://blog.fission.codes/building-actual-budget-with-james...
Re: Don’t we all just want to use SQL on the front end?
#75Earlier quoted context omitted.
This is a really interesting interface design, but seems like for any non-trivial database it would be too easy to make mistakes and give the client too much access. Also seems like it's be really easy to end up with performance issues. Also, there's basically zero information hiding. The database is your interface. Changing the schema in any way whatsoever is a breaking change to the API! You haven't really saved yo…
> You haven't really saved yourself from the hassle of designing and maintaining backward compatibility for the API. Another way to look at it is that changing the database schema is already a problem for the API which has to talk to it, so you're not really saving yourself any work by putting an extra layer between the frontend and the database. In fact, if anything, you're doubling the amount of work, because there…
If you have 100 other teams each with 5+ developers consuming your API -- or especially if your API is a product -- then keeping the API to frontend interface relatively stable with rare breaking changes is much more valuable than saving yourself even a major time commitment on DB to API work.
On the other hand, if you have relatively few clients -- or if the clients are "lower status"/"cheaper" teams -- saving time on the DB to API work a the expense of client teams might make sense.
Re: Don’t we all just want to use SQL on the front end?
#76A simple statement like SELECT Age FROM Employee WHERE name = 'Frank' turns into a monstrosity like
POST Employee/_search { "query": { "bool": { "must": [ { "match": { "name": "Frank" } } ] } }, "fields": [ "Age" ] }
Thankfully they added rudimentary SQL support so I could use it in ad-hoc queries.
Re: Don’t we all just want to use SQL on the front end?
#77I have to look into it, but some posters mention blitz.js, this may be just such a thing.
Re: Don’t we all just want to use SQL on the front end?
#78A better solution would be a GraphQL like API that leverages SQL.
Re: Don’t we all just want to use SQL on the front end?
#79Of course it's been tried. It's because it's been tried enough that people now tell you to hide SQL behind a middle layer...
Re: Don’t we all just want to use SQL on the front end?
#80For those not familiar, check out Postgraphile.
Came here to say this. To expound a bit, you can use it as a highly pluggable/extensible express plugin which you can point at any postgres db and get all CRUD and other operations exposed in GraphQL, without writing any code. You can easily hide or rename fields that you don't want exposed, override their behavior in Node, and add generated columns or fancy SQL mutations either in JS or directly in your DB and have…