You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClickHouse-JDBC client is an open-source project, and we welcome any contributions from the community. Please share your ideas, contribute to the codebase, and help us maintain up-to-date documentation.
- To build a multi-release jar use JDK 17+ with `~/.m2/toolchains.xml`
14
+
```xml
15
+
<?xml version="1.0" encoding="UTF8"?>
16
+
<toolchains>
17
+
<toolchain>
18
+
<type>jdk</type>
19
+
<provides>
20
+
<version>17</version>
21
+
</provides>
22
+
<configuration>
23
+
<jdkHome>/usr/lib/jvm/java-17-openjdk</jdkHome>
24
+
</configuration>
25
+
</toolchain>
26
+
</toolchains>
27
+
```
28
+
29
+
### Build modules
30
+
- JDK 8 Use `mvn -Dj8 -DskipITs clean verify` to compile and generate packages.
31
+
- JDK 17+ Use create a multi-release jar (see [JEP-238](https://openjdk.java.net/jeps/238)) please verify that you added `~/.m2/toolchains.xml` and run `mvn -DskipITs clean verify`
32
+
33
+
34
+
To create a native binary of JDBC driver for evaluation and testing:
35
+
36
+
- [install GraalVM](https://www.graalvm.org/latest/docs/getting-started/) and optionally [upx](https://upx.github.io/)
37
+
38
+
- make sure you have [native-image](https://www.graalvm.org/latest/docs/getting-started/#native-image) installed, and then build the native binary
Processed 500,000,000 rows in 25,267.89 ms (19,787,963.94 rows/s)
76
+
```
77
+
78
+
## Testing
79
+
80
+
By default, [docker](https://docs.docker.com/engine/install/) is required to run integration test. Docker image(defaults to `clickhouse/clickhouse-server`) will be pulled from Internet, and containers will be created automatically by [testcontainers](https://www.testcontainers.org/) before testing. To test against specific version of ClickHouse, you can pass parameter like `-DclickhouseVersion=22.8` to Maven.
81
+
82
+
In the case you don't want to use docker and/or prefer to test against an existing server, please follow instructions below:
83
+
84
+
- make sure the server can be accessed using default account(user `default` and no password), which has both DDL and DML privileges
85
+
- add below two configuration files to the existing server and expose all defaults ports for external access
86
+
-[ports.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/config.d/ports.xml) - enable all ports
87
+
- and [users.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/users.d/users.xml) - accounts used for integration test
88
+
Note: you may need to change root element from `clickhouse` to `yandex` when testing old version of ClickHouse.
89
+
- make sure ClickHouse binary(usually `/usr/bin/clickhouse`) is available in PATH, as it's required to test `clickhouse-cli-client`
90
+
- put `test.properties` under either `~/.clickhouse` or `src/test/resources` of your project, with content like below:
91
+
```properties
92
+
clickhouseServer=x.x.x.x
93
+
# below properties are only useful for test containers
94
+
#clickhouseVersion=latest
95
+
#clickhouseTimezone=UTC
96
+
#clickhouseImage=clickhouse/clickhouse-server
97
+
#additionalPackages=
98
+
```
99
+
100
+
### Tooling
101
+
We use [TestNG](http://org.testng/doc) as testing framework and for running ClickHouse Local instance [testcontainers](https://www.testcontainers.org/modules/databases/clickhouse/).
102
+
103
+
### Running unit tests
104
+
105
+
Does not require a running ClickHouse server.
106
+
Running the maven commands above will trigger the test.
It's time consuming to run all benchmarks against all drivers using different parameters for comparison. If you just need some numbers to understand performance, please refer to [this](https://github.com/ClickHouse/clickhouse-java/issues/768) and watch [this](https://github.com/ClickHouse/clickhouse-java/issues/928) for more information and updates.
More examples can be found at [here](../../tree/main/examples/jdbc).
133
-
134
-
## Build with Maven
135
-
136
-
Use `mvn -Dj8 -DskipITs clean verify` to compile and generate packages if you're using JDK 8. To create a multi-release jar (see [JEP-238](https://openjdk.java.net/jeps/238)), please use JDK 17+ with `~/.m2/toolchains.xml` like below, and run `mvn -DskipITs clean verify` instead.
137
-
138
-
```xml
139
-
<?xml version="1.0" encoding="UTF8"?>
140
-
<toolchains>
141
-
<toolchain>
142
-
<type>jdk</type>
143
-
<provides>
144
-
<version>17</version>
145
-
</provides>
146
-
<configuration>
147
-
<jdkHome>/usr/lib/jvm/java-17-openjdk</jdkHome>
148
-
</configuration>
149
-
</toolchain>
150
-
</toolchains>
151
-
```
152
-
153
-
To create a native binary of JDBC driver for evaluation and testing:
154
-
155
-
-[install GraalVM](https://www.graalvm.org/latest/docs/getting-started/) and optionally [upx](https://upx.github.io/)
156
-
157
-
- make sure you have [native-image](https://www.graalvm.org/latest/docs/getting-started/#native-image) installed, and then build the native binary
Processed 500,000,000 rows in 25,267.89 ms (19,787,963.94 rows/s)
195
-
```
196
-
197
-
## Testing
198
-
199
-
By default, [docker](https://docs.docker.com/engine/install/) is required to run integration test. Docker image(defaults to `clickhouse/clickhouse-server`) will be pulled from Internet, and containers will be created automatically by [testcontainers](https://www.testcontainers.org/) before testing. To test against specific version of ClickHouse, you can pass parameter like `-DclickhouseVersion=22.8` to Maven.
200
-
201
-
In the case you don't want to use docker and/or prefer to test against an existing server, please follow instructions below:
202
-
203
-
- make sure the server can be accessed using default account(user `default` and no password), which has both DDL and DML privileges
204
-
- add below two configuration files to the existing server and expose all defaults ports for external access
205
-
-[ports.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/config.d/ports.xml) - enable all ports
206
-
- and [users.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/users.d/users.xml) - accounts used for integration test
207
-
Note: you may need to change root element from `clickhouse` to `yandex` when testing old version of ClickHouse.
208
-
- make sure ClickHouse binary(usually `/usr/bin/clickhouse`) is available in PATH, as it's required to test `clickhouse-cli-client`
209
-
- put `test.properties` under either `~/.clickhouse` or `src/test/resources` of your project, with content like below:
210
-
```properties
211
-
clickhouseServer=x.x.x.x
212
-
# below properties are only useful for test containers
See the [jdbc driver docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/jdbc).
231
71
232
-
It's time consuming to run all benchmarks against all drivers using different parameters for comparison. If you just need some numbers to understand performance, please refer to [this](https://github.com/ClickHouse/clickhouse-java/issues/768) and watch [this](https://github.com/ClickHouse/clickhouse-java/issues/928) for more information and updates.
72
+
## Contributing
73
+
Check out our [contributing guide](./CONTRIBUTING.md).
Copy file name to clipboardExpand all lines: clickhouse-client/README.md
+5-55
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
3
3
Async Java client for ClickHouse. `clickhouse-client` is an abstract module, so it does not work by itself until being used together with an implementation like `clickhouse-http-client`, `clickhouse-grpc-client` or `clickhouse-cli-client`.
4
4
5
+
## Documentation
6
+
See the [ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/client) for the full documentation entry.
7
+
5
8
## Configuration
6
9
7
10
You can pass any client option([common](https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-client/src/main/java/com/clickhouse/client/config/ClickHouseClientOption.java), [http](https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-http-client/src/main/java/com/clickhouse/client/http/config/ClickHouseHttpOption.java), [grpc](https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-grpc-client/src/main/java/com/clickhouse/client/grpc/config/ClickHouseGrpcOption.java), and [cli](https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-cli-client/src/main/java/com/clickhouse/client/cli/config/ClickHouseCommandLineOption.java)) to `ClickHouseRequest.option()` and [server setting](https://clickhouse.com/docs/en/operations/settings/) to `ClickHouseRequest.set()` before execution, for instance:
[Default value](https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-client/src/main/java/com/clickhouse/client/config/ClickHouseDefaults.java) can be either configured via system property or environment variable.
0 commit comments