1 import ./make-test-python.nix ({ pkgs, ... }: {
3 meta.maintainers = with pkgs.lib.maintainers; [ ];
6 services.clickhouse.enable = true;
7 virtualisation.memorySize = 4096;
12 # work around quote/substitution complexity by Nix, Perl, bash and SQL.
13 tableDDL = pkgs.writeText "ddl.sql" "CREATE TABLE `demo` (`value` FixedString(10)) engine = MergeTree PARTITION BY value ORDER BY tuple();";
14 insertQuery = pkgs.writeText "insert.sql" "INSERT INTO `demo` (`value`) VALUES ('foo');";
15 selectQuery = pkgs.writeText "select.sql" "SELECT * from `demo`";
19 machine.wait_for_unit("clickhouse.service")
20 machine.wait_for_open_port(9000)
23 "cat ${tableDDL} | clickhouse-client"
26 "cat ${insertQuery} | clickhouse-client"
29 "cat ${selectQuery} | clickhouse-client | grep foo"