Skip to content

Commit c468e89

Browse files
makonigevartosky
andauthored
1.3.1 (#15)
* swift-docc-plugin 1.3.0 * async-http-client 1.19.0 * replaced deprecated .createNew with the new .singleton * Adding _find capability. (#13) * docs * tabs * renames * added test for find method with body * docs added * findError added * tests renamed * added test for find method with generic type * docs * README updated * updated dependencies * docs updated * try Swift 5.7.1 * Update build-ubuntu.yml * Swift 5.7.3 * Revert "Swift 5.7.3" This reverts commit ab8f67a. * updated dependencies * Docs updated * Delete .github/workflows/CodeQL.yml --------- Co-authored-by: Gregório Gevartosky Torrezan <[email protected]>
1 parent 8e0707c commit c468e89

File tree

8 files changed

+44
-64
lines changed

8 files changed

+44
-64
lines changed

.github/workflows/CodeQL.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

Package.resolved

Lines changed: 25 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717

1818

19-
This is simple lib to work with CouchDB in Swift.
19+
This is a simple lib to work with CouchDB in Swift.
2020
- Latest version is based on async/await and requires Swift 5.6 and newer. Works with Vapor 4.50 and newer.
2121
- Version 1.0.0 can be used with Vapor 4 without async/await. Swift 5.3 is required
22-
- You can use old version for Vapor 3 from vapor3 branch or using version < 1.0.0.
22+
- You can use the old version for Vapor 3 from vapor3 branch or using version < 1.0.0.
2323

24-
The only depndency for this lib is <a href="https://github.com/swift-server/async-http-client">async-http-client</a>
24+
The only dependency for this lib is <a href="https://github.com/swift-server/async-http-client">async-http-client</a>
2525

26-
## Documentaion
26+
## Documentation
2727

2828
You can find docs, examples and even tutorials [here](https://spaceinbox.me/docs/couchdbclient/documentation/couchdbclient).
2929

@@ -55,7 +55,7 @@ let couchDBClient = CouchDBClient(
5555
)
5656
```
5757

58-
If you don’t want to have your password in the code you can pass COUCHDB_PASS param in you command line. For example you can run your Server Side Swift project:
58+
If you don’t want to have your password in the code you can pass COUCHDB_PASS param in your command line. For example you can run your Server Side Swift project:
5959
```bash
6060
COUCHDB_PASS=myPassword /path/.build/x86_64-unknown-linux-gnu/release/Run
6161
```
@@ -113,7 +113,7 @@ try await couchDBClient.update(
113113
print(doc) // doc will have updated name and _rev values now
114114
```
115115

116-
Delete data example:
116+
Delete data:
117117

118118
```swift
119119
let response = try await couchDBClient.delete(fromDb: "databaseName", doc: doc)

Sources/CouchDBClient/CouchDBClient.docc/CouchDBClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Source code is available on [GitHub](https://github.com/makoni/couchdb-vapor).
88

99
CouchDBClient allows you to make simple requests to CouchDB. It's using Swift Concurrency (async/await) and supports Linux, iOS 13+ and macOS 10.15+.
1010

11-
It's using [AsyncHTTPClient](https://github.com/swift-server/async-http-client) which makes it easy to use CouchDBClient for server-side development with Vapor 4.
11+
It's using [AsyncHTTPClient](https://github.com/swift-server/async-http-client) which makes it easy to use CouchDBClient for server-side development with Vapor 4. But it's easy to use it with any iOS or macOS app. Check the Essentials section for examples.
1212

1313
Currently CouchDBClient supports:
1414
- Check if DB exists.

Sources/CouchDBClient/CouchDBClient.docc/Tutorials/ErrorsHandling/ErrorsHandlingTutorial.tutorial

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414

1515
@Steps {
1616
@Step {
17-
`CouchDBClient` has an Error enum `CouchDBClientError`. Some of enum values has nested error of `CouchDBError` type that represents error messages from CouchDB.
17+
`CouchDBClient` has an Error enum `CouchDBClientError`. Some enum values have nested errors of `CouchDBError` type that represent error messages from CouchDB.
1818

1919
@Code(name: "main.swift", file: ErrorsHandlingTutorial-1.swift)
2020
}
2121

2222
@Step {
23-
You can wrap your code in do-catch block to catch a CouchDB error during insert operation.
23+
You can wrap your code in a do-catch block to catch a CouchDB error during insert operation.
2424

2525
@Code(name: "main.swift", file: ErrorsHandlingTutorial-2.swift)
2626
}
2727

2828
@Step {
29-
Same for update to find out what's wrong.
29+
Same for updates to find out what's wrong.
3030

3131
@Code(name: "main.swift", file: ErrorsHandlingTutorial-3.swift)
3232
}
3333

3434
@Step {
35-
And same for get operation. CouchDB will return an error message if username or password is incorrect for example.
35+
And same for a get operation. CouchDB will return an error message if the username or password is incorrect for example.
3636

3737
@Code(name: "main.swift", file: ErrorsHandlingTutorial-4.swift)
3838
}

Sources/CouchDBClient/CouchDBClient.docc/Tutorials/Tutorial Table of Contents.tutorial

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@Tutorials(name: "CouchDBClient") {
22
@Intro(title: "Getting started") {
3-
Check tutorials for using the lib in a macOS app or with Vapor for server-side developement.
3+
Check tutorials for using the lib in a macOS app or with Vapor for server-side development.
44

55
@Image(source: logo.png, alt: "CouchDBClient logo")
66
}
@@ -15,7 +15,7 @@
1515
}
1616

1717
@Chapter(name: "Errors handling") {
18-
Examples handling CouchDBClient errors and errors from CouchDB.
18+
Examples of handling CouchDBClient errors and errors from CouchDB.
1919

2020
@Image(source: chapter1.png, alt: "CouchDBClient logo")
2121

Sources/CouchDBClient/CouchDBClient.docc/Tutorials/macOS/macOSTutorial.tutorial

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@Section(title: "Initializaton") {
99
@ContentAndMedia {
10-
Adding CouchDBClient in your project.
10+
Adding CouchDBClient to your project.
1111

1212
@Image(source: chapter1.png, alt: "Application icon")
1313
}
@@ -38,7 +38,7 @@
3838
}
3939

4040
@Step {
41-
Define a model for your CouchDB document. It should confirm to `Codable` and `CouchDBRepresentable` protocols.
41+
Define a model for your CouchDB document. It should conform to `Codable` and `CouchDBRepresentable` protocols.
4242

4343
@Code(name: "main.swift", file: macOSTutorial-4.swift)
4444
}
@@ -50,13 +50,13 @@
5050
}
5151

5252
@Step {
53-
Here's an example of updating the document. CouchDBClient will also update `_rev` value of your document with the value from CouchDB after saving.
53+
Here's an example of updating the document. CouchDBClient will also update the `_rev` value of your document with the value from CouchDB after saving.
5454

5555
@Code(name: "main.swift", file: macOSTutorial-6.swift)
5656
}
5757

5858
@Step {
59-
Getting document by it's `_id` from DB with that method will parse JSON into your model if you'll provide it as a generic type.
59+
Getting a document by its `_id` from DB with that method will parse JSON into your model if you provide it as a generic type.
6060

6161
@Code(name: "main.swift", file: macOSTutorial-7.swift)
6262
}

Sources/CouchDBClient/CouchDBClient.docc/Tutorials/vapor/VaporTutorial.tutorial

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
}
3333

3434
@Step {
35-
Define you data model for CouchDB document. Nested `Row` and `RowsResponse` models will be used to parse CouchDB responses.
35+
Define your data model for CouchDB documents. Nested `Row` and `RowsResponse` models will be used to parse CouchDB responses.
3636

3737
@Code(name: "main.swift", file: VaporTutorial-3.swift)
3838
}
3939

4040
@Step {
41-
Get you document from DB. That example is using `CouchDB View` to find the document by url field. It's map function needs `key` param which is `appUrl` in our case.
41+
Get your document from DB. That example is using `CouchDB View` to find the document by the url field. Its map function needs a `key` param which is `appUrl` in our case.
4242

4343
@Code(name: "main.swift", file: VaporTutorial-4.swift)
4444
}

0 commit comments

Comments
 (0)