RetoolをClickHouseに接続する
1. 接続詳細を収集する
To connect to ClickHouse with HTTP(S) you need this information:
-
The HOST and PORT: typically, the port is 8443 when using TLS or 8123 when not using TLS.
-
The DATABASE NAME: out of the box, there is a database named
default, use the name of the database that you want to connect to. -
The USERNAME and PASSWORD: out of the box, the username is
default. Use the username appropriate for your use case.
The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console. Select the service that you will connect to and click Connect:

Choose HTTPS, and the details are available in an example curl command.

If you are using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.
以下は、ClickHouseにHTTP(S)で接続するために必要な情報です:
-
HOSTとPORT: 通常、TLSを使用する場合はポートが8443、使用しない場合は8123です。
-
DATABASE NAME: デフォルトでは、
defaultという名前のデータベースがあります。接続したいデータベースの名前を使用します。 -
USERNAMEとPASSWORD: デフォルトでは、ユーザー名は
defaultです。使用ケースに適したユーザー名を使用します。
ClickHouse Cloudサービスの詳細は、ClickHouse Cloudコンソールで確認できます。 接続するサービスを選択し、Connectをクリックしてください:

HTTPSを選択すると、詳細はexample curlコマンドで確認できます。

セルフマネージドのClickHouseを使用している場合は、接続の詳細がClickHouse管理者によって設定されます。
2. ClickHouseリソースを作成する
Retoolアカウントにログインし、Resources タブに移動します。「Create New」 -> 「Resource」を選択します:

利用可能なコネクタのリストから「JDBC」を選択します:

セットアップウィザードで、「Driver name」として com.clickhouse.jdbc.ClickHouseDriver を選択することを確認します:

次の形式でClickHouseの資格情報を入力します: jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD。
インスタンスがSSLを必要とする場合やClickHouse Cloudを使用している場合は、接続文字列に &ssl=true を追加します。これにより、次のようになります: jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD&ssl=true

その後、接続をテストします:

これで、ClickHouseリソースを使用してアプリに進むことができるはずです。