In the last few days I’m experimenting with substituting CRUD API code with Stored Procedures which directly produce the endpoints JSON as a single-row scalar value. API is then just a wrapper that authenticates, validates input and streams the DB’s JSON directly to the client.
No ORMs, no SQL generators etc.
All SQL is where it should belong: in the database
API does only single „CALL myfunc(…)“ db calls
A simple centralised error handler can accurately report errors from the database
No weird mixed row/json columns scanning into structs and re-marshalling everything to JSON
Codebase is collapsing to 20% (by LOCs)
Stored Procedures can use wonderfully declarative SQL code
Response times in the microseconds, even for multiple queries, all happens inside the DB
More side effects:
the data model can change and evolve without touching the API at all
Zero deploys mean zero downtime
the API application is so tiny, I could easily switch it to any programming language I want (yes, even Common Lisp) without worrying about available databases libraries, type mapping and rewriting tens of thousands of lines of intermixed language/SQL-code.
The general direction of the dev industry is heading in the opposite direction. More ORMs, more layers, more database abstraction. More weird proprietary cloud databases with each their own limited capabilities and query language.
So you tell me: Is it crazy? Is it wrong? Why do I have doubts despite everything working out beautifully?
Using #golang for a project since the SDK has really nice structs and instantiators for all the API calls where the #Python SDK for the project just phoned it in for all the payloads.
This article is all about how things are looking great for hiring Laravel devs in 2024, and I’m not seeing it.
I’ve been job-searching for 3 months, and very, very, very few of those jobs are decent-paying #PHP / #Laravel jobs. Sure, PHP/Laravel jobs exist, but most (anecdotally) pay far less than the rate others are willing to pay for #Golang, #Python, #Rust, #Elixir, #Java, #Csharp, and #TypeScript developers.
The industry does not value the output of PHP developers.
Dear #golang, please stop telling me/others that "clearly you haven't worked in a large codebase" if we express any sort of distaste for go.
If you want me to run screaming from your language community, talk like this.
I wish this were just a one off, but I see this sort of comment all of the time with golang specifically.
I've maintained large code bases before go was invented and I have criticisms of go directly tied to that understanding. It doesn't make go bad, but it also isn't absolute
Anyone hacking #golang code aware of any #JSON marshaller implementation that will let me have any say in what's "pretty"? The default one is waaay to spacious for anything but the most simple of objects. I can't believe I'm coming up with nothing searching for this. Kinda hoping it's just me being a boomer with no idea about how to use the internet? Please say it's so.
How do I run a simple, comprehensible #Mastodon instance? I'm not crazy about setting up and installing the usual server. I have simple needs and want to experiment with my own instance.
It would be great if such were written in #Rust. But I can hold my nose and use a different modern compiled language.
I do know how to search the web. I do! But it's easy accidentally to waste time on something hopeless.
I'll happily be the only user and tolerate jankiness.
People working on #Go#Golang applications: I want to pick a way to make SQL queries (most likely SQLite and/or Postgres) but I'm totally lost with the many options available. Do you have any recommendations please? 🙇
It's for a web app, a smallish Activity Pub social network.
Has anyone worked with #golang, #nix (with or without nix-shell), and #JetBrains GoLand?
My first passes at researching this doesn't show me many promising results. Some vscode discussion suggest launching vscode from the CLI after entering the shell.nix-enabled project directory, but not sure how I feel about that.
I try to learn Golang, just because. To load a go module locally I need to manually update my go.mod file via go mod edit -replace command. Result: replace example.com/greetings => ../greetings. I hate Go already.. I hate it. Don't get me started on enums/unions. Error handling: err != nil ;). Ps. Hello world binary contains debug symbols by default and is 4MB.
I think I stick with C, C++, I even dare to say JS with Bun and whatever not.
I am baffled by how much trouble I’m having at writing #rust at a decent clip. #Golang I felt pretty good at after a few months, same with #Python and #PHP. Meanwhile I’ve been trying to write anything useful in Rust for months and it’s so incredibly slow going.
I’m shocked people are enthusiastic about adopting this for their jobs. If I had a specific part of an app that needed more speed, absolutely. But as a general purpose language? I’m not seeing it yet.
I’ll keep ramming my head against it but have not enjoyed myself thus far. If writing a proof of concept in python takes me 4 hours, rewriting that in rust clocks in easily at 12-16 hours.
That sinking feeling that it's gonna be real hard going back to #Python, or even other compiled languages like #Golang, after having already gotten so used to the comforting embrace of the #Rust compiler.
What’s your favorite library in #Go#Golang for web authentication? Or any other recommendation to implement it (like std lib or just a JWT one etc).
Ideally it supports classic credentials, 2FA and passkeys. Bonus for OAuth providers that you can extend (if it does not support Mastodon out of the box for example).