Skip to content

Commit 3a38ada

Browse files
require minium swift 5.2
1 parent 0f881b8 commit 3a38ada

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
jobs:
44
bionic:
55
docker:
6-
- image: vapor/swift:5.1-bionic
6+
- image: vapor/swift:5.2-bionic
77
steps:
88
- checkout
99
- run: apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4; echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" | tee /etc/apt/sources.list.d/clickhouse.list

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
77
"state": {
88
"branch": null,
9-
"revision": "4b4d6605aa2e4f0c2ae3c7563795ae3bec259fff",
10-
"version": "1.2.1"
9+
"revision": "0a8dddbe15cd72f7bb5e47951fb7c1eb0836dfc2",
10+
"version": "1.2.2"
1111
}
1212
},
1313
{

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.2
22

33
import PackageDescription
44

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Features:
1515

1616
## Installation:
1717

18-
1. Add `ClickHouseNIO` as a dependency to your `Package.swift`
18+
1. Add `ClickHouseVapor` as a dependency to your `Package.swift`
1919

2020
```swift
2121
dependencies: [
@@ -34,7 +34,9 @@ $ swift build
3434

3535
## Usage
3636

37-
1. Configure the connection credentials with a Vapor 4 appliation. Usually this is done in `config.swift`.
37+
1. Configure the connection credentials with a Vapor 4 application. Usually this is done in `config.swift`.
38+
39+
Note: `maxConnectionsPerEventLoop` controls the number of connections per thread. If you have 4 CPU cores and Vapor is using 4 eventLoops, 8 connections will be used. `requestTimeout` is the timeout to establish a connection. It does not limit query runtime.
3840

3941
```swift
4042
import ClickHouseVapor
@@ -53,7 +55,7 @@ app.clickHouse.configuration = try ClickHousePoolConfiguration(
5355
)
5456
```
5557

56-
2. Define a table with fields and an engine.
58+
1. Define a table with fields and an engine.
5759

5860
```swift
5961
public class TestModel : ClickHouseModel {
@@ -119,7 +121,7 @@ let result2 = try! TestModel.select(
119121
).wait()
120122

121123
print(result2.id) // ["ax51", "x010"]
122-
print(result2.timetamp) // [200, 100]
124+
print(result2.timestamp) // [200, 100]
123125

124126
// Perform raw queries, but assign the result to TestModel
125127
let sql = "SELECT timestamp, stationID FROM default.test"
@@ -128,6 +130,7 @@ let result2 = try! TestModel.select(on: app.clickHouse, sql: sql).wait()
128130

129131

130132
## TODO
133+
- Consider query timeouts
131134
- Implement more engines
132135
- Review and declare version 1.0.0
133136

0 commit comments

Comments
 (0)