StorageDone-iOS
Swift library to make easy use local document-oriented databases in iOS apps.
Installation
To install StorageDone add this line to your Podfile
pod 'StorageDone'
Usage
StorageDone lets you save Codable models in a local database very easily.
First create a model
Then create a StorageDoneDatabase
object and save an instance of a Codable model in it
Reading database content will retrieve an array of the decleared model
Other methods allow filtering and deletion.
Primary key
A model can implement PrimaryKey
protocol, in order to have an attribute set as database primary key
Primary keys come in combination with insert or update methods
RxSwift
Every operation has its RxSwift version. Each can be used through rx extension
Operators
Database objects can use different custom operators, which wrap try-catch logic and give a more compact way to access database
Queries
Get and delete commands can use queries. Queries can be built in different ways, using custom operator or extensions on parameter name
Live queries
Using live queries it's possible to observe database changes.
In order to stop observing just call cancel on LiveQuery object.
RxSwift live queries
Live queries are also available through RxSwift extensions.
To stop observing changes just dispose the disposable or alternatively add it to a dispose bag.
Advanced queries
Using advanced queries lets to specify filtering expression, ordering logic and priority, limit and skip values.
All of these parameters are optional. The only limitation is that skip is ignored if limit parameter is not present.
Author
Dario Pellegrini, pellegrini.dario.1303@gmail.com