1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-25 12:24:39 +02:00
OpenIntegrations/docs/en/md/SQLite/Orm/Delete-posts.mdx

80 lines
2.1 KiB
Plaintext
Raw Normal View History

2025-01-07 12:27:20 +03:00
---
sidebar_position: 6
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Delete records
Deletes records from the table
`Function DeletePosts(Val Table, Val Filters = "", Val Connection = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Table | --table | String | ✔ | Table name |
| Filters | --filter | Array of Structure | ✖ | Filters array. See GetRecordsFilterStrucutre |
| Connection | --db | String, Arbitrary | ✖ | Existing connection or database path |
Returns: Structure Of KeyAndValue, String - Result of query execution
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-02-09 18:15:36 +03:00
Base = "C:\Users\Administrator\AppData\Local\Temp\v8_5571_2fd.sqlite";
2025-01-07 12:27:20 +03:00
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);
```
2025-01-10 12:07:46 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# 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}" \
2025-02-10 12:36:30 +03:00
--db "C:\Users\Administrator\AppData\Local\Temp\cfyaxf0knp1.sqlite"
2025-01-10 12:07:46 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: 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}" ^
2025-02-10 12:36:30 +03:00
--db "C:\Users\Administrator\AppData\Local\Temp\cfyaxf0knp1.sqlite"
2025-01-10 12:07:46 +03:00
```
</TabItem>
</Tabs>
```json title="Result"
{
"result": true
}
```