mergesort / Bodega

A simple store for all your basic needs, and a foundational data layer primitive for iOS and Mac apps. 🐱
https://build.ms/bodega/docs
MIT License
319 stars 27 forks source link

Remove dependency on SQLite.swift #17

Open mergesort opened 1 year ago

mergesort commented 1 year ago

SQLiteSwift is doing rather minimal work in the SQLiteStorageEngine, and was added because I was building a prototype to see the performance of an SQLite-backed StorageEngine. Now that the concept has been proven out quite successfully I'd like to remove the dependency, though I don't have the time to do so at the moment so Bodega can be a free-standing solution without depending on any other libraries.

I'd be very happy to accept help if someone has the expertise to convert the handful of queries that make up the read/write/delete operations in SQLiteStorageEngine, and willing to offer help if you run into any issues. 🙇🏻‍♂️

mcomisso commented 1 year ago

Hi, I was about to open an issue on Boutique to ask it, but I think it's more relevant here:

I have some viewModels using @Stored(in:) to access the database data.

The problem I'm hitting is that unit tests tend to fail easily when the whole suite is running (as the persistence of mocks happen during integration tests): is there an option to enable Sqlite in-memory database, or could be added after this work? Or alternatively, do you recommend any strategy to test components with @Stored properties?

liamnichols commented 1 year ago

It looks like there is a PR in progress for this already which is great 🙌 I just wanted to add a note though in case anybody runs into the same issue that I faced:

When trying to use Bodega/Boutique in a Swift Playgrounds project, you’ll run into an issue because 0.13.x of SQLite.swift has a non-swift package target. The solution would be to update the dependency to 0.14.x, or better yet, remove the dependency entirely (this ticket)