Perfect-CouchDB 简体中文
February 9, 2018 · View on GitHub
Apache CouchDB connector for Perfect
NOTE: This project is in beta
This project provides connectivity to Apache CouchDB.
Full documentation can be found at http://www.perfect.org/docs/CouchDB.html
This package builds with Swift Package Manager and is part of the Perfect project. It was written to be stand-alone and so does not require PerfectLib or any other components.
Ensure you have installed and activated the latest Swift 4.0 tool chain.
Example usage:
var test = CouchDB()
var auth = CouchDBAuthentication("perfect", "perfect", auth: .basic)
test.connector.port = 5984
test.authentication = auth
let code = test.databaseCreate("testdb")
let dataSubmit = ["one":"ONE","two":"TWO"]
do {
let (addCode, response) = try test.addDoc("testdb",doc: dataSubmit)
print(addCode)
print(response)
} catch {
print(error)
}
Building
Add this project as a dependency in your Package.swift file.
.Package(url: "https://github.com/PerfectlySoft/Perfect-CouchDB.git", majorVersion: 3)
Further Information
For more information on the Perfect project, please visit perfect.org.




