I’ve mentioned a number of libraries for working with SQLite databases, most recently the SQLite.Swift wrapper.
Here’s an open source library providing a thin Swift based wrapper for working with SQLite databases called ALBNoSQLDB.
AALBNoSQLDB allows you to set values using a JSON string, and provides easy error handling.
Here’s a code snippet from the readme showing how one could set the values within a table using JSON:
let jsonValue = "{\"numValue\":1,\"name\":\"Account Category\",\"dateValue\":\"2014-8-19T18:23:42.434-05:00\",\"arrayValue\":[1,2,3,4,5]}"
if ALBNoSQLDB.setValue(table:"categories", key:"category1", value:jsonValue, autoDeleteAfter:nil) {
// value was set properly
} else {
// handle error
}
if ALBNoSQLDB.setValue(table:"categories", key:"category1", value:jsonValue, autoDeleteAfter:nil) {
// value was set properly
} else {
// handle error
}
You can find ALBNoSQLDB on Github here.
A nice SQLite wrapper.
Original article: Open Source Library Providing A SQLite Wrapper With A No SQL Syntax
©2015 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.