File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function prepareRequest(RequestOptions $requestOptions) : RequestInterfac
3333 PHP_QUERY_RFC3986
3434 );
3535
36- return $ this ->requestFactory ->createRequest ('POST ' , $ query )
36+ return $ this ->requestFactory ->createRequest ('POST ' , $ query === '' ? '' : ' ? ' . $ query )
3737 ->withBody ($ this ->streamFactory ->createStream ($ requestOptions ->sql ));
3838 }
3939}
Original file line number Diff line number Diff line change 44
55namespace SimPod \ClickHouseClient \Tests \Client ;
66
7+ use SimPod \ClickHouseClient \Exception \ServerError ;
78use SimPod \ClickHouseClient \Format \Json ;
89use SimPod \ClickHouseClient \Format \JsonCompact ;
910use SimPod \ClickHouseClient \Format \JsonEachRow ;
@@ -130,4 +131,12 @@ public function providerJsonEachRow() : iterable
130131CLICKHOUSE ,
131132 ];
132133 }
134+
135+ public function testSettingsArePassed () : void
136+ {
137+ self ::expectException (ServerError::class);
138+ $ this ->expectExceptionMessage ("DB::Exception: Database `non-existent` doesn't exist " );
139+
140+ $ this ->client ->select ('SELECT 1 ' , new JsonCompact (), ['database ' => 'non-existent ' ]);
141+ }
133142}
You can’t perform that action at this time.
0 commit comments