Skip to main content

Delete records

Deletes records from the table

Function DeletePosts(Val Table, Val Filters = "", Val Connection = "") Export

ParameterCLI optionTypeRequiredDescription
Table--tableStringTable name
Filters--filterArray of StructureFilters array. See GetRecordsFilterStrucutre
Connection--dbString, ArbitraryExisting connection or database path

Returns: Structure Of KeyAndValue, String - Result of query execution


1C:Enterprise/OneScript code example
    Base  = "C:\Users\Administrator\AppData\Local\Temp\v8_E607_1d.sqlite";
Table = "test";

Filters = New Array;

FilterStructure = New Structure;

FilterStructure.Insert("field", "name");
FilterStructure.Insert("type" , "=");
FilterStructure.Insert("value", "Vitaly A.");
FilterStructure.Insert("union", "AND");
FilterStructure.Insert("raw" , False);

Filters.Add(FilterStructure);

Result = OPI_SQLite.DeletePosts(Table, FilterStructure, Base);
    # JSON data can also be passed as a path to a .json file

oint sqlite DeletePosts \
--table "test" \
--filter "{'field':'name','type':'=','value':'Vitaly A.','union':'AND','raw':false}" \
--db "C:\Users\Administrator\AppData\Local\Temp\3pbdgv5r4nm.sqlite"
Result
{
"result": true
}