You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-02 20:52:28 +02:00
91 lines
2.8 KiB
Plaintext
Vendored
91 lines
2.8 KiB
Plaintext
Vendored
Address = "127.0.0.1";
|
|
Login = "bayselonarrend";
|
|
Password = "12we...";
|
|
Base = "testbase1";
|
|
|
|
TLS = True;
|
|
Port = 3306;
|
|
Options = New Structure;
|
|
Options.Insert("addr" , Address);
|
|
Options.Insert("db" , Base);
|
|
Options.Insert("login", Login);
|
|
Options.Insert("pass" , Password);
|
|
Options.Insert("port" , Port);
|
|
|
|
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GenerateConnectionString", Options);
|
|
|
|
If TLS Then
|
|
Options = New Structure;
|
|
Options.Insert("trust", True);
|
|
|
|
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GetTLSSettings", Options);
|
|
Else
|
|
TLSSettings = Undefined;
|
|
EndIf;
|
|
|
|
// All records without filters
|
|
|
|
Table = "testtable";
|
|
|
|
// When using the connection string, a new connection is initialised,
|
|
// which will be closed after the function is executed.
|
|
// If several operations are performed, it is desirable to use one connection,
|
|
// previously created by the CreateConnection function()
|
|
Options = New Structure;
|
|
Options.Insert("table", Table);
|
|
Options.Insert("dbc", ConnectionString);
|
|
Options.Insert("tls", TLSSettings);
|
|
|
|
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GetRecords", Options);
|
|
|
|
// Filter, selected fields, limit and sorting
|
|
|
|
Options = New Structure;
|
|
Options.Insert("addr" , Address);
|
|
Options.Insert("db" , "test_data");
|
|
Options.Insert("login", Login);
|
|
Options.Insert("pass" , Password);
|
|
Options.Insert("port" , Port);
|
|
|
|
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GenerateConnectionString", Options);
|
|
|
|
Table = "test_data";
|
|
|
|
Fields = New Array;
|
|
Fields.Add("first_name");
|
|
Fields.Add("last_name");
|
|
Fields.Add("email");
|
|
|
|
Filters = New Array;
|
|
|
|
FilterStructure1 = New Structure;
|
|
|
|
FilterStructure1.Insert("field", "gender");
|
|
FilterStructure1.Insert("type" , "=");
|
|
FilterStructure1.Insert("value", "Male");
|
|
FilterStructure1.Insert("union", "AND");
|
|
FilterStructure1.Insert("raw" , False);
|
|
|
|
FilterStructure2 = New Structure;
|
|
|
|
FilterStructure2.Insert("field", "id");
|
|
FilterStructure2.Insert("type" , "BETWEEN");
|
|
FilterStructure2.Insert("value", "20 AND 50");
|
|
FilterStructure2.Insert("raw" , True);
|
|
|
|
Filters.Add(FilterStructure1);
|
|
Filters.Add(FilterStructure2);
|
|
|
|
Sort = New Structure("ip_address", "DESC");
|
|
Count = 5;
|
|
|
|
Options = New Structure;
|
|
Options.Insert("table" , Table);
|
|
Options.Insert("fields", Fields);
|
|
Options.Insert("filter", Filters);
|
|
Options.Insert("order" , Sort);
|
|
Options.Insert("limit" , Count);
|
|
Options.Insert("dbc" , ConnectionString);
|
|
Options.Insert("tls" , TLSSettings);
|
|
|
|
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GetRecords", Options); |