I Hate SQL
So, I don’t like SQLite that much.
But I still use it a lot for legacy projects. And, honestly, when you have some fixed data that’s unlikely to change it’s really not that bad of a system. It’s only when you have like tons of random lists of data like for a game that SQLite becomes an issue.
So I still use it for my language learning app Litany and I like it.
But recently I made a pretty big change to Litany. I might write about it here later. But first I want to rant a bit about SQL.
What Is SQL, Really?
Ah, SQL. What is SQL? No one knows. And I know no one knows because people invented something called ‘NoSQL’. So you’d think NoSQL wouldn’t use SQL, right? Nope, NoSQL uses SQL: Structured Query Language. Well, not all NoSQL systems, but some.
Welcome to 2022, where words don’t mean anything anymore.
OK, I do know what SQL is. SQL is a way to interface with a database. Or, at least, I thought I knew what SQL was. And then I started making the new update for my app.
The Problem
So I was trying to implement this new feature which would mark the first few thousand words as viewed.

This meant saving thousands of rows to the database all at once. So I tried it… and it made my entire app unresponsive. OK, there must be a way to speed this up. And thankfully there was. The batch() operation.
Basically if you have a bunch of commands to execute, instead of calling them all at once you call them on a Batch object. Then you do batch.execute() and it runs all the commands for you.
Easy peasy.
But then I got a new error: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction. So apparently I had to use a transaction object.
OK, I’ll use a transaction object. Sheesh. And it appeared to work… at first. But then it started happening again. So then I removed the transaction object. And now it works.
I Hate SQL
I’ve never liked SQL much. But this story makes me hate SQL even more.
I’ve actually had a similar problem with slow database writes before. Back in the day…
Anyways the root of the problem is that SQL doesn’t know what it wants to be. SQL stands for Structured Query Language. So… does that mean a language as in a programming language or does it mean a language like an interface?
🤷♀
So instead of choosing whether it wants to be a real turning complete programming language or an easy to use database interface it does neither. It is this poorly documented completely unnecessary middle-ware between you and the database.
It makes me so mad. You could have made SQL great by just defining it as a set of operations on binary files but no no no, you just had to make this terrible abstraction layer that doesn’t even make any sense. And it’s not even Turing complete.
Oh wait, this just in, I’m getting reports that SQL is actually a Turing complete programming language.
Oh, well, the point is that SQL is not a great language to use in programming.
In my opinion SQL should just be a basic interface for reading and writing data, not this monstrosity of various undocumented features. As the old adage goes: “Do one thing and do it well.”






