Database
It is a protocol to easily handle database read/write on top of Realm as singleton.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
Database is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Database"
Usage
Configuration
DatabaseConfiguration
handles the database configuration, the database implementation has been made on top of Databaseable
protocol.
In configuration you can set:
- name, it is not linked yet
- type, it supports
disk
ormemory
database - debug, it supports different logging types
DatabaseDebugVerbosity
supports:
- none, no message will be shown (Default)
- all, all messages will be shown
- error, only setting and error will be shown
- message, all messages will be shown
Database
Databaseable
protocol allows you to:
-
get
to get items ofRealm
type or an item using key -
save
to save fromJSON
,Realm
object or sequence -
delete
to remove an object ofRealm
type
Author
matteocrippa, @ghego20
License
Database is available under the MIT license. See the LICENSE file for more info.