You've already forked OpenIntegrations
							
							
				mirror of
				https://github.com/Bayselonarrend/OpenIntegrations.git
				synced 2025-10-30 23:47:46 +02:00 
			
		
		
		
	Main build (Jenkins)
This commit is contained in:
		| @@ -30,7 +30,11 @@ import TabItem from '@theme/TabItem'; | ||||
|  | ||||
|  | ||||
| ```bsl title="1C:Enterprise/OneScript code example" | ||||
|     TFN = GetTempFileName("sqlite"); | ||||
|  | ||||
|     Connection = OPI_SQLite.CreateConnection(TFN); | ||||
|  | ||||
|     Closing = OPI_SQLite.CloseConnection(Connection); | ||||
| ``` | ||||
|   | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ sidebar_position: 1 | ||||
| import Tabs from '@theme/Tabs'; | ||||
| import TabItem from '@theme/TabItem'; | ||||
|  | ||||
| # Create connection  | ||||
| # Create Connection  | ||||
|  Creates a connection to the specified base | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -34,7 +34,63 @@ Without specifying the `ForcifyResult` flag, result data is returned only for qu | ||||
|  | ||||
|  | ||||
| ```bsl title="1C:Enterprise/OneScript code example" | ||||
|     TFN = GetTempFileName("sqlite"); | ||||
|  | ||||
|     Connection = OPI_SQLite.CreateConnection(TFN); | ||||
|  | ||||
|     // CREATE | ||||
|  | ||||
|     QueryText = " | ||||
|     |CREATE TABLE test_table ( | ||||
|     |id INTEGER PRIMARY KEY, | ||||
|     |name TEXT, | ||||
|     |age INTEGER, | ||||
|     |salary REAL, | ||||
|     |is_active BOOLEAN, | ||||
|     |created_at DATETIME, | ||||
|     |data BLOB | ||||
|     |);"; | ||||
|  | ||||
|     Result = OPI_SQLite.ExecuteSQLQuery(QueryText, , , Connection); | ||||
|  | ||||
|     // INSERT with parameters | ||||
|  | ||||
|     QueryText = " | ||||
|     |INSERT INTO test_table (name, age, salary, is_active, created_at, data) | ||||
|     |VALUES (?1, ?2, ?3, ?4, ?5, ?6);"; | ||||
|  | ||||
|     ParameterArray = New Array; | ||||
|     ParameterArray.Add("Vitaly"); // TEXT | ||||
|     ParameterArray.Add(25); // INTEGER | ||||
|     ParameterArray.Add(1000.12); // REAL | ||||
|     ParameterArray.Add(True); // BOOL | ||||
|     ParameterArray.Add(OPI_Tools.GetCurrentDate()); // DATETIME | ||||
|     ParameterArray.Add(ПолучитьДвоичныеДанныеИзСтроки("Hello world")); // BLOB | ||||
|  | ||||
|     Result = OPI_SQLite.ExecuteSQLQuery(QueryText, ParameterArray, , Connection); | ||||
|  | ||||
|     // SELECT (The result of this query is shown in the Result block) | ||||
|  | ||||
|     QueryText = "SELECT id, name, age, salary, is_active, created_at, data FROM test_table;"; | ||||
|  | ||||
|     Result = OPI_SQLite.ExecuteSQLQuery(QueryText, , , Connection); | ||||
|  | ||||
|     // Transaction | ||||
|  | ||||
|     QueryText = "BEGIN TRANSACTION; | ||||
|     | CREATE TABLE IF NOT EXISTS users ( | ||||
|     | id INTEGER PRIMARY KEY AUTOINCREMENT, | ||||
|     | name TEXT NOT NULL, | ||||
|     | age INTEGER NOT NULL | ||||
|     | ); | ||||
|     | INSERT INTO users (name, age) VALUES ('Alice', 30); | ||||
|     | INSERT INTO users (name, age) VALUES ('Bob', 25); | ||||
|     | INSERT INTO users (name, age) VALUES ('Charlie', 35); | ||||
|     | COMMIT;"; | ||||
|  | ||||
|     Result = OPI_SQLite.ExecuteSQLQuery(QueryText, , , Connection); | ||||
|  | ||||
|     Closing = OPI_SQLite.CloseConnection(Connection); | ||||
| ``` | ||||
|   | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user