Alright so the caveat of going with a json based database model and keeping it all in memory is that there's a recommended maximum of memory you can keep at a time, or you risk your app crashing.
However, according to this: https://stackoverflow.com/a/29094983
For newer iPhones that's somewhere between 1GB and 2GB, which is a massive amount of data for a json database, something stupid like like ~7.5m to ~15m records. So for _most_ applications, if you also do some purging of ancient records, you'd be fine
Done! By doing the re-write I managed to also remove like half the code base. I'll have a blog post about my data management solution soon enough.
Ok, so apparently constant read-writes to storage file is not the most efficient. Will re-write to read once on app open, and write once on app close. Everything else will happen in memory.
I do plan to release the database as open source soon as well, once I can generalise it enough to support all sorts of use cases.
Actually it was way easier to do it through @ObservableObject rather than @State.
So far so good, the UI is reacting to file write's, so now I just have to figure out how to update the file when @State changes and I should be able to replace Realm just fine.
Just finished rewriting a Swift lib I first made 9 months ago or so back when I was really really stupid as opposed to just stupid that I am now when it comes to all-things Swift. Still a README to do for it, and some finishing touches, but generally speaking: https://git.sr.ht/~askonomm/StaticContent/tree
I mean yes, I can add onTapGesture, and then manually add the text to the clipboard, but I mean, maybe you don't want the whole text?
So I just wrote a blog post on something, not really even sure what, but I guess something to do with programming languages.
Senior Software Engineer at https://greenpowermonitor.com, blogger, husband.
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.