4 ms·
this is barely three sentences and doesn't even get into WAL mode or other stuff wrt journaling.
by adzm 2y ago
this is barely three sentences and doesn't even get into WAL mode or other stuff wrt journaling.
- skeeter2020 2y agoYeah pretty light for HN content, especially in an area like SQLite which has great visibility into how stuff works. Though technically I guess it's right? Maybe some value for those who know nothing about SQLite and have dismissed it out of hand for lots of things it is actually very good at (like backing most websites that aren't unicorn scale).
- TeMPOraL 2y agoIn general I agree, but in this case, even those three sentences could be very useful to many. I remember when I first started playing with SQLite, looking at some project using it, browsing some examples, skimming the SQL side of the docs - I had an impression that it's customary to open a single connection to a given SQLite database, and use it throughout the entire program. And I mean, it feels logical - it's a file database, and you wouldn't fopen() the same file independently several times and write to it when there's even a remote chance you'll end up doing so concurrently, even on a single thread. So it's valuable to spell it out up front that yes, you can and should open multiple connections to the same SQLite database.