CouchbaseLiteSwift


#1

Hey folks!

I’ve written a small helper library for working with Couchbase Lite on iOS & Swift and thought of sharing it here, so you can make use of it.

The reason I’ve created it was, because I felt like working with Couchbase Lite & Swift should be easy and feel more natural.

The library automatically takes care of caching and querying new records,
as well as establishing and maintain connections to your database.

Some querying examples:

if let username = textField.text where Query<User>()
  .conditions("username == $username")
  .params(["username": username])
  .count == 1{

    print("username exists!")
}

Or the same query by using the more generic Query<AnyModel> type:

if let username = textField.text where Query< AnyModel>(type: User.self)
  .conditions("username == $username")
  .params(["username": username])
  .count == 1{

    print("username exists!")
}

So give it a try and tell me what you think!