Skip to content

Commit

Permalink
feat: pass parameters natively via http interface along the query
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Jan 16, 2024
1 parent 111baba commit 20d53a5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ jobs:
php-version:
- "8.2"
clickhouse-version:
- "22.1"
- "22.2"
- "22.3"
- "22.4"
- "22.5"
- "22.6"
- "22.7"
- "22.8"
- "22.9"
# - "22.1"
# - "22.2"
# - "22.3"
# - "22.4"
# - "22.5"
# - "22.6"
# - "22.7"
# - "22.8"
# - "22.9"
- "22.10"
- "22.11"
- "22.12"
Expand Down
25 changes: 20 additions & 5 deletions tests/Param/ParamValueConverterRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public function testAllTypesAreCovered(): void
));

foreach (self::$types as $type) {
if (ClickHouseVersion::get() < 2303 && $type === 'Decimal256') {
self::markTestSkipped();
}

if (ClickHouseVersion::get() < 2211 && in_array($type, ['JSON', 'Object'], true)) {
self::markTestSkipped();
}

self::assertTrue(in_array($type, $coveredTypeNames, true), $type);
}
}
Expand Down Expand Up @@ -99,10 +107,14 @@ public static function providerConvert(): Generator
yield 'Array (array)' => ['Array(String)', ['foo', 'bar'], "['foo','bar']"];
yield 'Tuple' => ['Tuple(String, Int8)', "('k',1)", "('k',1)"];
yield 'Tuple (array)' => ['Tuple(String, Int8)', ['k', 1], "('k',1)"];
yield 'JSON' => ['JSON', '{"k":"v"}', '{"k":"v"}'];
yield 'JSON (array)' => ['JSON', ['k' => 'v'], '{"k":"v"}'];
yield 'Object' => ["Object('JSON')", '{"k":"v"}', '{"k":"v"}'];
yield 'Object (array)' => ["Object('JSON')", ['k' => 'v'], '{"k":"v"}'];

if (ClickHouseVersion::get() < 2211) {
yield 'JSON' => ['JSON', '{"k":"v"}', '{"k":"v"}'];
yield 'JSON (array)' => ['JSON', ['k' => 'v'], '{"k":"v"}'];
yield 'Object' => ["Object('JSON')", '{"k":"v"}', '{"k":"v"}'];
yield 'Object (array)' => ["Object('JSON')", ['k' => 'v'], '{"k":"v"}'];
}

yield 'Map' => ['Map(String, UInt64)', "{'k1':1}", "{'k1':1}"];
yield 'Nested' => [
'Nested(id UUID, a String)',
Expand Down Expand Up @@ -182,7 +194,10 @@ public static function providerConvert(): Generator
yield 'Decimal32' => ['Decimal32(2)', 3.33, '3.33'];
yield 'Decimal64' => ['Decimal64(2)', 3.33, '3.33'];
yield 'Decimal128' => ['Decimal128(2)', 3.33, '3.33'];
yield 'Decimal256' => ['Decimal256(2)', 3.33, '3.33'];

if (ClickHouseVersion::get() >= 2303) {
yield 'Decimal256' => ['Decimal256(2)', 3.33, '3.33'];
}

yield 'IPv4' => ['IPv4', '1.2.3.4', '1.2.3.4'];
yield 'IPv6' => ['IPv6', '2001:0000:130F:0000:0000:09C0:876A:130B', '2001:0:130f::9c0:876a:130b'];
Expand Down

0 comments on commit 20d53a5

Please sign in to comment.