1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-04-28 20:46:05 +02:00
Files
OpenIntegrations/docs/en/examples/SQLite/AddRecords.txt
T
Vitaly the Alpaca (bot) c666f4e470 Main build (Jenkins)
2026-02-10 22:03:20 +03:00

36 lines
1.4 KiB
Plaintext
Vendored

Image = "https://hut.openintegrations.dev/test_data/picture.jpg";
OPI_TypeConversion.GetBinaryData(Image); // Image - Type: BinaryData
PictureFile = GetTempFileName("png");
Image.Write(PictureFile); // PictureFile - File to disk
Base = "/tmp/vnnmoosn.qqb.sqlite";
Table = "test";
DataArray = New Array;
RowStructure2 = New Structure;
RowStructure2.Insert("name" , "Vitaly"); // TEXT
RowStructure2.Insert("age" , 25); // INTEGER
RowStructure2.Insert("salary" , 1000.12); // REAL
RowStructure2.Insert("is_active" , True); // BOOL
RowStructure2.Insert("created_at", OPI_Tools.GetCurrentDate()); // DATETIME
RowStructure2.Insert("data" , New Structure("blob", Image)); // BLOB
RowStructure1 = New Structure;
RowStructure1.Insert("name" , "Lesha"); // TEXT
RowStructure1.Insert("age" , 20); // INTEGER
RowStructure1.Insert("salary" , 200.20); // REAL
RowStructure1.Insert("is_active" , False); // BOOL
RowStructure1.Insert("created_at", OPI_Tools.GetCurrentDate()); // DATETIME
RowStructure1.Insert("data" , New Structure("blob", PictureFile)); // BLOB
DataArray.Add(RowStructure2);
DataArray.Add(RowStructure1);
Options = New Structure;
Options.Insert("table", Table);
Options.Insert("rows" , DataArray);
Options.Insert("db" , Base);
Result = OPI_TestDataRetrieval.ExecuteTestCLI("sqlite", "AddRecords", Options);