Skip to content

Commit 5caa6ff

Browse files
authored
style: indent snippets (#302)
1 parent 16c2866 commit 5caa6ff

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

src/Snippet/CurrentDatabase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public static function run(ClickHouseClient $clickHouseClient): string
2222

2323
$currentDatabase = $clickHouseClient->select(
2424
<<<'CLICKHOUSE'
25-
SELECT currentDatabase() AS database
26-
CLICKHOUSE,
25+
SELECT currentDatabase() AS database
26+
CLICKHOUSE,
2727
$format,
2828
);
2929

src/Snippet/DatabaseSize.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public static function run(ClickHouseClient $clickHouseClient, string|null $data
2727

2828
$currentDatabase = $clickHouseClient->selectWithParams(
2929
<<<'CLICKHOUSE'
30-
SELECT sum(bytes) AS size
31-
FROM system.parts
32-
WHERE active AND database=:database
33-
CLICKHOUSE,
30+
SELECT sum(bytes) AS size
31+
FROM system.parts
32+
WHERE active AND database=:database
33+
CLICKHOUSE,
3434
['database' => $databaseName ?? Expression::new('currentDatabase()')],
3535
$format,
3636
);

src/Snippet/Parts.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public static function run(
3636

3737
$output = $clickHouseClient->selectWithParams(
3838
<<<CLICKHOUSE
39-
SELECT *
40-
FROM system.parts
41-
WHERE
42-
database = :database
43-
AND table = :table $whereActiveClause
44-
ORDER BY max_date
45-
CLICKHOUSE,
39+
SELECT *
40+
FROM system.parts
41+
WHERE
42+
database = :database
43+
AND table = :table $whereActiveClause
44+
ORDER BY max_date
45+
CLICKHOUSE,
4646
[
4747
'database' => $database,
4848
'table' => $table,

src/Snippet/ShowCreateTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public static function run(ClickHouseClient $clickHouseClient, string $tableName
2222

2323
$output = $clickHouseClient->select(
2424
<<<CLICKHOUSE
25-
SHOW CREATE TABLE $tableName
26-
CLICKHOUSE,
25+
SHOW CREATE TABLE $tableName
26+
CLICKHOUSE,
2727
$format,
2828
);
2929

src/Snippet/ShowDatabases.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public static function run(ClickHouseClient $clickHouseClient): array
2626

2727
$output = $clickHouseClient->select(
2828
<<<'CLICKHOUSE'
29-
SHOW DATABASES
30-
CLICKHOUSE,
29+
SHOW DATABASES
30+
CLICKHOUSE,
3131
$format,
3232
);
3333

src/Snippet/TableSizes.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ public static function run(ClickHouseClient $clickHouseClient, string|null $data
3030

3131
return $clickHouseClient->selectWithParams(
3232
<<<'CLICKHOUSE'
33-
SELECT
34-
name AS table,
35-
database,
36-
max(size) AS size,
37-
min(min_date) AS min_date,
38-
max(max_date) AS max_date
39-
FROM system.tables
40-
ANY LEFT JOIN (
41-
SELECT
42-
table,
43-
database,
44-
sum(bytes) AS size,
45-
min(min_date) AS min_date,
46-
max(max_date) AS max_date
47-
FROM system.parts
48-
WHERE active AND database = :database
49-
GROUP BY table,database
50-
) parts USING ( table, database )
51-
WHERE database = :database AND storage_policy <> ''
52-
GROUP BY table, database
53-
CLICKHOUSE,
33+
SELECT
34+
name AS table,
35+
database,
36+
max(size) AS size,
37+
min(min_date) AS min_date,
38+
max(max_date) AS max_date
39+
FROM system.tables
40+
ANY LEFT JOIN (
41+
SELECT
42+
table,
43+
database,
44+
sum(bytes) AS size,
45+
min(min_date) AS min_date,
46+
max(max_date) AS max_date
47+
FROM system.parts
48+
WHERE active AND database = :database
49+
GROUP BY table,database
50+
) parts USING ( table, database )
51+
WHERE database = :database AND storage_policy <> ''
52+
GROUP BY table, database
53+
CLICKHOUSE,
5454
['database' => $databaseName ?? Expression::new('currentDatabase()')],
5555
$format,
5656
)->data;

0 commit comments

Comments
 (0)