Perfect-CouchDB 简体中文
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.
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)
}
Add this project as a dependency in your Package.swift file.
.Package(url: "https://github.com/PerfectlySoft/Perfect-CouchDB.git", majorVersion: 3)
For more information on the Perfect project, please visit perfect.org.