High Performance SQLite has been the single best pragmatic guide for SQLite on the Internet. This course is a must have for all developers at any stage in their DB journey.Tony Mannino
Build with and integrate SQLite into your production applications.
I've made my test data available for you to use and follow along.
One of the great things about SQLite, and there are so many great things, but one of them is that it's incredibly safe. It's incredibly safe and robust, and it gives you these strong guarantees that you would expect out of a database. And we owe a lot of that to its history of operating in pretty hostile environments. And I don't necessarily mean hostile like battlefield, although I think SQLite was written for a battleship, so maybe kind of. I mean hostile like your cell phone because the battery could die at any moment up to and including in the middle of a transaction.
So SQLite has operated on mobile devices since the very beginning. That's one of its great strengths is it's an embedded database and so it goes great on mobile devices. Mobile devices have batteries and they used to have media, storage media that could just be removed at any moment. And so SQLite has to be resilient to power failures and the media completely disappearing. And so they have 600 lines of test code for every single line of library code.
That's a lot. Do I wanna do that? No way. No way I'm gonna write that mini test. Do I want my database to be that tested?
Yeah. I super duper do. So they have these custom file systems that simulate power outages or media being removed. They have fuzz tests to test every single thing you could think of and that's because they have this commitment to maintain backwards compatibility and future proof it through 2050 at the very earliest. That's that's their commitment so far.
They may push it. That leads us to 1, a little sticky wicket. I don't know if it's a problem, but it's a little bit it's a little bit weird. They say that they're open source, not open contribution. That sounds strange.
Right? So the source is available. You can go look at it. You can go read it. You there's no copyright whatsoever.
You can take it and do whatever you want with it, but they do not accept contributions from outsiders. One of the things or one of the reasons that they don't accept contributions is for this high reliability, high stability. They they claim that to keep it as reliable and stable as it is, very very few people can work on it, and they just don't accept pull requests from the outside world. I'm not here to make a judgment on if that's right or wrong. That's just what they say.
There is a fork that is open contribution and that's libSQL or lib SQL, and that's maintained by the Turso team. It is a fork of SQLite with a few things added that is open contribution slash open source. Their goal is to merge them back together, but that would take SQLite changing its stance on contributions. So SQLite is incredibly reliable, incredibly safe, strong ACID guarantees just like every other database, a transaction is not going to be half committed. It's all or nothing, even if the power goes out and that gives me great comfort.