1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-20 10:00:46 +02:00
Files
OpenIntegrations/docs/en/examples/ClickHouse/CompleteGRPCSending.txt
T
Vitaly the Alpaca (bot) 34c83810b0 Main build (Jenkins)
2026-02-16 09:39:10 +03:00

23 lines
854 B
Plaintext
Vendored

URL = "http://localhost:9101";
Login = "bayselonarrend";
Password = "12we...";
Authorization = New Structure(Login, Password);
ConnectionSettings = OPI_ClickHouse.GetGRPCConnectionSettings(URL, Authorization);
Connection = OPI_ClickHouse.CreateGRPCConnection(ConnectionSettings);
Timeout = 10000;
OpeningResult = OPI_ClickHouse.OpenGRPCStream(Connection, Timeout);
If Not OpeningResult["result"] Then
Raise OpeningResult["error"];
Else
StreamID = OpeningResult["streamId"];
EndIf;
QueryText = "SELECT number FROM system.numbers LIMIT 1";
Request = OPI_ClickHouse.GetRequestSettings(QueryText, , , , "JSON");
Sending = OPI_ClickHouse.SendGRPCMessage(Connection, StreamID, Request);
Result = OPI_ClickHouse.CompleteGRPCSending(Connection, StreamID);