2025-06-29 14:35:33 +03:00
|
|
|
Address = "127.0.0.1";
|
2025-02-14 23:21:49 +03:00
|
|
|
Login = "bayselonarrend";
|
2025-06-29 14:35:33 +03:00
|
|
|
Password = "12we...";
|
2025-02-15 13:38:30 +03:00
|
|
|
Base = "test_data";
|
2025-02-14 23:21:49 +03:00
|
|
|
|
2025-09-01 14:51:24 +03:00
|
|
|
TLS = True;
|
|
|
|
|
Port = 5432;
|
|
|
|
|
ConnectionString = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
|
|
|
|
|
|
|
|
|
If TLS Then
|
|
|
|
|
TLSSettings = OPI_PostgreSQL.GetTLSSettings(True);
|
|
|
|
|
Else
|
|
|
|
|
TLSSettings = Undefined;
|
|
|
|
|
EndIf;
|
2025-02-14 23:21:49 +03:00
|
|
|
|
2025-02-15 13:38:30 +03:00
|
|
|
Table = "test_data";
|
2025-02-14 23:21:49 +03:00
|
|
|
|
|
|
|
|
FieldsStructure = New Structure;
|
2025-02-15 13:38:30 +03:00
|
|
|
FieldsStructure.Insert("ip_address", New Structure("VARCHAR", "127.0.0.1"));
|
2025-02-14 23:21:49 +03:00
|
|
|
|
|
|
|
|
Filters = New Array;
|
|
|
|
|
|
|
|
|
|
FilterStructure = New Structure;
|
|
|
|
|
|
2025-02-15 13:38:30 +03:00
|
|
|
FilterStructure.Insert("field", "gender");
|
2025-02-14 23:21:49 +03:00
|
|
|
FilterStructure.Insert("type" , "=");
|
2025-02-15 13:38:30 +03:00
|
|
|
FilterStructure.Insert("value", New Structure("VARCHAR", "Male"));
|
2025-02-14 23:21:49 +03:00
|
|
|
FilterStructure.Insert("raw" , False);
|
|
|
|
|
|
|
|
|
|
Filters.Add(FilterStructure);
|
|
|
|
|
|
2025-02-15 22:58:22 +03:00
|
|
|
// 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()
|
2025-09-01 14:51:24 +03:00
|
|
|
Result = OPI_PostgreSQl.UpdateRecords(Table
|
|
|
|
|
, FieldsStructure
|
|
|
|
|
, FilterStructure
|
|
|
|
|
, ConnectionString
|
|
|
|
|
, TLSSettings);
|