smi2/phpclickhouse
PHP ClickHouse Client
1.26.610
13M downloads/mo
#944 most downloaded on Packagist
smi2/phpClickHouse
What this package is like to depend on
Last release 2 months ago
10 Jun 2026
Release timing varies
gaps range from 2 weeks to 1.2 years
Some releases are documented
notes for 14 of 52 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
52 releases · first in 2016
8 releases in the last 12 months
see the full history below
Release timeline
52 releases · Aug 2016 to Jun 2026Releases
latest 52-
1.26.61010 Jun 2026Release notes
Open source →Bug Fixes
- Distributed DDL (
ON CLUSTER) formatting reworked (#241, #263, #262) —Http::prepareWrite()no longer appendsFORMAT JSONto the SQL ofON CLUSTERqueries. Instead the response format is requested via thedefault_format=JSONquery setting:CREATE USER / GRANT / ALTER ... ON CLUSTERno longer fail withSYNTAX_ERRORfrom a strayFORMAT JSON(#241)CREATE / ALTER ... ON CLUSTERresults are now parseable JSON again — no moreCan't find metawhen reading the per-host execution status (#263)- a bare
ON CLUSTERsubstring insideINSERTdata (e.g.'REGION CLUSTER') is no longer mistaken for the keyword —\bword boundaries match the real keyword only (#262)
- False-positive error detection on large JSON responses (#261) —
Statement::hasErrorClickhouse()now confirms a tail-regex match withjson_validate()(PHP 8.3+) before flagging an error, so valid JSON whose data legitimately contains ClickHouse exception text is not reported as a failure (@jradtilbrook)
Testing
- New
tests/ClickHouse26/OnClusterTest.php— distributed DDL regression tests (CREATE/ALTER/CREATE USER ... ON CLUSTER); skips gracefully when no Keeper/ZooKeeper backend is configured - Embedded ClickHouse Keeper added to the test environment (
tests/clickhouse-latest-config/keeper.xml, mounted indocker-compose.yamland copied in CI) so the single-nodedefaultcluster can executeON CLUSTERqueries testInsertWithOnClusterInDataadded to both CH 21 and CH 26 client tests (#262)
Merged PRs
- #261 — Fix false positive error detection when JSON data contains ClickHouse exception text (@jradtilbrook)
Closed Issues
- Distributed DDL (
-
1.26.42323 Apr 2026Release notes
Open source →2026-04-23 [Release 1.26.423]
Bug Fixes
- Escape single quotes and backslashes in scalar string native params (#258, #259) —
convertParamValue()now escapes\→\\and'→\'for scalarStringparams inselectWithParams()/writeWithParams(). Previously strings likehello\causedCANNOT_PARSE_ESCAPE_SEQUENCEin ClickHouse (@sander-hash, @tom-on-the-internet)
Testing
- 5 new native-params tests — scalar strings with trailing backslash, embedded backslash, single quote, injection attempt, and
writeWithParamswith backslash
Merged PRs
- #259 — Added escape for scalar string (@sander-hash)
Closed Issues
- #258 — Scalar string params are not escaped, causing
CANNOT_PARSE_ESCAPE_SEQUENCE
- Escape single quotes and backslashes in scalar string native params (#258, #259) —
-
1.26.41716 Apr 2026Release notes
Open source →2026-04-17 [Release 1.26.417]
Bug Fixes
- Correctly encode arrays for native param binding (#257) —
convertParamValue()now produces ClickHouse-compatible array literals['foo','bar'](single quotes) instead of JSON format["foo","bar"]. Previously anyArray(String)parameter inselectWithParams()/writeWithParams()failed with a parse error (@sander-hash) - Escape single quotes and backslashes in array strings — follow-up to #257. Strings containing
'or\are now properly escaped (e.g."it's"→'it\'s'), preventing query errors and array-element injection
Testing
- 6 new native-params tests — cover
Array(UInt32),Array(String), empty arrays, strings with single quotes, strings with backslashes, and injection attempts
Merged PRs
- #257 — Correctly encode array for native param binding (@sander-hash)
- Correctly encode arrays for native param binding (#257) —
-
1.26.41211 Apr 2026Release notes
Open source →2026-04-12 [Release 1.26.412]
Bug Fixes
- Fix bindParams() TypeError with numeric keys (#256) —
bindParams()now casts integer array keys to string before passing tobindParam(string $column), restoring backward compatibility with numerically-indexed arrays. Affected downstream packages likephpclickhouse-laravel(@yehezkel-fullpath)
Testing
- Flaky tests excluded from default runs —
testConnectTimeout,testStreamInsert,testStreamInsertFormatJSONEachRowmarked@group flakyand excluded via PHPUnit config. Run separately with./vendor/bin/phpunit --group flaky - 2 new binding tests —
testBindParamsWithNumericKeys,testBindParamsWithMixedKeyscovering #256 regression
Closed Issues
- #256 — Breaking change: strict string type on
Bindings::bindParam()rejects integer keys
- Fix bindParams() TypeError with numeric keys (#256) —
-
1.26.41009 Apr 2026Release notes
Open source →2026-04-10 [Release 1.26.410]
New Features
readWithParams()(#254) — stream query results with native ClickHouse typed parameters ({name:Type}syntax), combining server-side parameter binding with streaming output (@sander-hash)
Code Quality
- Stringable interfaces (#252) — all Type classes now explicitly implement
Stringablefor consistency (@sander-hash) - PHPStan test fixes (#253) — removed redundant assertions in static tests, improved assertion quality (@sander-hash)
- Documentation sync — updated GitHub Pages (docs/) with
readWithParams()in native-params, streaming, and per-query-settings guides
Merged PRs
- #252 — Add Stringable interfaces for types (@sander-hash)
- #253 — Fix phpstan errors in test files (@sander-hash)
- #254 — Added native params for read function (@sander-hash)
-
1.26.40606 Apr 2026Release notes
Open source →2026-04-06 [Release 1.26.406]
WARNING : PHP 8.1+
New Features
- Boolean Type (#251) — new
ClickHouseDB\Type\Booleanclass withfromString(),fromBool(),getValue(),__toString()(@sander-hash)
Code Quality
- PHP 8.1+ native type declarations — full migration across all 33 src/ files: property types, parameter types, return types. Interfaces (
Degeneration,IStream,Type) unchanged for backward compatibility - PR Security Review rules — added supply-chain attack detection checklist to CLAUDE.md (outbound network calls, data exfiltration, obfuscation, credential leakage patterns)
- Security audit — full code audit of src/, results saved in
secure-scan.md. All clean: no backdoors, exfiltration, or obfuscation found
Testing
- 153 new static unit tests — run without ClickHouse server:
ValueFormatterTest(28) — SQL escaping, types, DateTimeInterface, ExpressionStrictQuoteLineTest(32) — CSV/TSV/Insert formatting, encodeStringSettingsTest(24) — get/set/is, sessions, timeouts, readonlyWriteToFileTest(15) — file validation, formats, gzipTypesTest(26+5) — UInt64, DateTime64, MapType, TupleType, Boolean and moreBindingsUnitTest(16) — compile_binds, Conditions {if}/{else}CurlerRequestResponseTest(35) — headers, auth, URL, JSON, dump
- Total: 313+ tests (CH 21.9 + CH 26.3 + static), all passing
Merged PRs
- #251 — feat: Add Boolean type (@sander-hash)
- Boolean Type (#251) — new
-
1.26.404 Apr 2026 -
1.24.40606 Apr 2026 -
1.6.015 Jan 2025 -
1.5.318 Jan 2024 -
1.5.216 Jan 2024Nothing published for this version
-
1.5.124 May 2023Nothing published for this version
-
1.5.020 Dec 2022Nothing published for this version
-
1.4.622 Jun 2022Nothing published for this version
-
1.4.509 Jun 2022Nothing published for this version
-
1.4.423 Apr 2022Nothing published for this version
-
1.4.320 Apr 2022Nothing published for this version
-
1.4.211 Feb 2022Nothing published for this version
-
1.4.120 Jan 2021Nothing published for this version
-
1.4.019 Jan 2021Nothing published for this version
-
1.3.1029 Sep 2020Nothing published for this version
-
1.3.903 Feb 2020Nothing published for this version
-
1.3.817 Jan 2020Nothing published for this version
-
1.3.720 Sep 2019Nothing published for this version
-
1.3.624 Aug 2019Nothing published for this version
-
1.3.528 Apr 2019Nothing published for this version
-
1.3.428 Apr 2019Nothing published for this version
-
1.3.324 Apr 2019Nothing published for this version
-
1.3.218 Mar 2019Nothing published for this version
-
1.3.125 Sep 2018Nothing published for this version
-
1.2.411 Sep 2018Nothing published for this version
-
1.2.330 Aug 2018Nothing published for this version
-
1.2.224 Jul 2018Nothing published for this version
-
1.2.116 Jul 2018Nothing published for this version
-
1.2.006 Jul 2018Nothing published for this version
-
1.1.203 Jul 2018Nothing published for this version
-
1.1.103 Jul 2018Nothing published for this version
-
1.1.002 Jul 2018Nothing published for this version
-
1.0.129 Jun 2018Nothing published for this version
-
1.0.025 Jun 2018Nothing published for this version
-
0.17.1222 Dec 2017Nothing published for this version
-
0.17.1122 Nov 2017Nothing published for this version
-
0.16.1025 Oct 2016 -
0.2.011 Aug 2016 -
0.1.006 Aug 2016 -
0.18.06.1919 Jun 2018Nothing published for this version
-
0.18.06.1817 Jun 2018Nothing published for this version
-
0.18.06.1717 Jun 2018Nothing published for this version
-
0.18.05.0910 May 2018Nothing published for this version
-
0.17.12.128 Dec 2017Nothing published for this version
-
0.17.0220 Feb 2017Nothing published for this version
-
0.16.0919 Sep 2016Release notes
Open source →- Version/Release names: [ zero dot year dot month]
- Support cluster: new class Cluster and ClusterQuery
- output_format_write_statistics, for clickhouse version > v1.1.54019-stable
- WriteToFile in select,selectAsync
- Degeneration for Bindings & Conditions
- $db->select(new Query("Select..."));
- remove findActiveHostAndCheckCluster , clusterHosts , checkServerReplicas
- Add cleanQueryDegeneration(),addQueryDegeneration()
- Need $db->enableQueryConditions(); for use Conditions ; default Conditions - disabled;
- float in CurlerRequest->timeOut(2.5) = 2500 ms
- tablesSize() - add
sizebytes