App::Sqitch::Engine::clickhouse(3)

Name
App::Sqitch::Engine::clickhouse - Sqitch ClickHouse Engine

Synopsis
  my $clickhouse = App::Sqitch::Engine->load( engine => 'clickhouse' );

Description
App::Sqitch::Engine::clickhouse provides the ClickHouse storage engine for Sqitch. It supports ClickHouse v25.8 and higher.

Interface

  Instance Methods
"cli"

Returns a list containing the "clickhouse" client and options to be passed to it. Used internally when executing scripts. Query parameters <https://github.com/clickHouse/clickhouse-odbc> in the URI that map to "clickhouse" client options will be passed to the client, as follows:

•   "SSLMode": "--secure"

    Assume that TLS is required in the client if SSLMode is set.

•   "NativePort": "--port"

    Sqitch-specific parameter for the client port. Required because the ODBC driver uses the HTTP ports (8123 or 8443 with "SSLMode") while the ClickHouse CLI uses the Native Protocol port (9000 or 9440 with "SSLMode"). Use this option to specify an alternative port for the CLI. See Network Ports <https://clickhouse.com/docs/guides/sre/network-ports> for additional information.

"username"

"password"

Overrides the methods provided by the target so that, if the target has no username or password, Sqitch can look them up in a configuration file (although it does not yet do so).

"uri"

Returns the URI used to connect to the database. It modifies the URI as follows:

hostname
    If the host name is not set, sets it from the $CLICKHOUSE_HOSTNAME environment variable or the hostname read from the ClickHouse configuration file.

port
    If the port is not set but the configuration file specifies port 9440, assume the HTTP port should also be secure and set it to 8443.

database
    If the database name is not set, sets it from the "database" parameter read from the ClickHouse configuration file.

query
    Sets ODBC query parameters <https://github.com/clickHouse/clickhouse-odbc> based on the "$.openSSL.client" parameters from the ClickHouse configuration file as follows:

    "privateKeyFile": "PrivateKeyFile"
        Path to private key file. Raises an error if both are set and not the same value.

    "certificateFile": "CertificateFile"
        Path to certificate file. Raises an error if both are set and not the same value.

    "caConfig": "CALocation"
        Path to the file or directory containing the CA/root certificates. Raises an error if both are set and not the same value.

    "secure", "port", "host", "verificationMode": "SSLMode"
        Sets the ODBC "SSLMode" parameter to "require" when the "secure" parameter from the configuration file is true or the port is 9440, or the host name from the configuration file or the target ends in ".clickhouse.cloud". If none of those are true but "verificationMode" is set, set the "SSLMode" query parameters as follows:

           verificationMode | SSLMode
          ------------------|-----------
           none             | [not set]
           relaxed          | allow
           strict           | require
           once             | require

Author
David E. Wheeler <david@justatheory.com>

License
Copyright (c) 2012-2026 David E. Wheeler, 2012-2021 iovation Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.