Predictable is a type-safe SwiftyCouchDB query API using Swift 4's Smart KeyPaths to extend upon CouchDB's design document querys.
- macOS
- Xcode 9.0+
- Swift 4.0+
Note: Uses SwiftyCouchDB as the CouchDB Wrapper.
Creating your database document object is simple, conforming to DBDocument
(Codable) is all that is required.
struct User: DBDocument {
var _id: String
var name: String
var email: String
var age: Int
}
To create your query without using CouchDB design documents just:
Query(User.self)
.for(\User.age > 22)
.by(\User.age)
.evaluate { (users, error) in
/* .. */
}