smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
741 stars 139 forks source link

Fix write method format #214

Open den-kuz opened 6 months ago

den-kuz commented 6 months ago

This PR https://github.com/smi2/phpClickHouse/pull/190 brings breaking changes.

First of all, we can not execute CREATE, DROP, ALTER without ON CLUSTER. Cause CREATE TABLE blabla ... FORMAT JSON will produce syntax error exception Second, this was very bad solution. 0 === strpos? What if query will have comment in start?

My PR fixes this issue, but breaks old code. But i think this is much better solution than the current one

Lanatel commented 2 months ago

Hi, @isublimity can you check this PR? There was a partial fix for this problem in PR #216, and queries without the ON CLUSTER statement are executed normally now. However, there are still errors when trying to execute CREATE, DROP, and ALTER queries with the ON CLUSTER statement, because not all of them support FORMAT. For example, it is not currently possible to execute CREATE USER, DROP USER, and similar queries.