Latest 1.0.2
Homepage https://github.com/satishbabariya/RethinkDB
License MIT
Platforms ios 8.0
Dependencies CocoaAsyncSocket, SCRAM
Authors

Language: Swift 4
CI Status
Version
License
Platform

A client driver for RethinkDB in Swift 4.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

RethinkDB is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RethinkDB'

Usage

R.connect(URL(string: "rethinkdb://localhost:28016")!, user: "admin", password: "") { err, connection in
    assert(err == nil, "Connection error: (err)")

    // Connected!
    R.dbCreate(databaseName).run(connection) { response in
        assert(!response.isError, "Failed to create database: (response)")

        R.db(databaseName).tableCreate(tableName).run(connection) { response in
            assert(!response.isError, "Failed to create table: (response)")

            R.db(databaseName).table(tableName).indexWait().run(connection) { response in
                assert(!response.isError, "Failed to wait for index: (response)")

                // Insert 1000 documents
                var docs: [ReDocument] = []
                for i in 0..<1000 {
                    docs.append(["foo": "bar", "id": i])
                }

                R.db(databaseName).table(tableName).insert(docs).run(connection) { response in
                    assert(!response.isError, "Failed to insert data: (response)")

                    R.db(databaseName).table(tableName).filter({ r in return r["foo"].eq(R.expr("bar")) }).run(connection) { response in 
                        ...
                    }

                    R.db(databaseName).table(tableName).count().run(connection) { response in
                        ...
                    }
                }
            }
        }
    }
}

Status

The driver implements the V1_0 protocol (which supports username/password authentication using SCRAM, and is available
from RethinkDB 2.3.0). Alternatively, you can also use V0_4. Some commands and optional arguments may still be missing,
but are usually easy to add to the code.

Author

Satish Babariya, [email protected]

License

RethinkDB is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RethinkDB",
    "version": "1.0.2",
    "summary": "A client driver for RethinkDB in Swift 4.",
    "homepage": "https://github.com/satishbabariya/RethinkDB",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Satish Babariya": "[email protected]"
    },
    "source": {
        "git": "https://github.com/satishbabariya/RethinkDB.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "RethinkDB/Classes/**/*",
    "dependencies": {
        "CocoaAsyncSocket": [],
        "SCRAM": []
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This