No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Predictable.xcodeproj
Sources/Predictable
Tests
.gitignore
Package.resolved
Package.swift
README.md

README.md

Predictable

Predictable is a type-safe SwiftyCouchDB query API using Swift 4's Smart KeyPaths to extend upon CouchDB's design document querys.

Requirements

  • macOS
  • Xcode 9.0+
  • Swift 4.0+

Usage

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
    /* .. */
  }