Skip to content

Commit

Permalink
#18 Время ожидания при выполнении запроса
Browse files Browse the repository at this point in the history
#16 Добавить описание изменений
  • Loading branch information
ret-Phoenix committed Mar 9, 2017
1 parent a64cff3 commit 4889055
Show file tree
Hide file tree
Showing 14 changed files with 437 additions and 211 deletions.
336 changes: 235 additions & 101 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,106 +1,240 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

{
"version": "0.1.0",
"command": "oscript",
"isShellCommand": true,
"showOutput": "silent",
"args": [
"-encoding=utf-8"
],
"tasks": [
{
"taskName": "OneScript: compile",
"args": [
"-compile",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
"version": "2.0.0",
"_runner": "terminal",
"windows": {
"command": "cmd",
"args": ["/c", "chcp 65001 &&"]
},
{
"taskName": "OneScript: check",
"args": [
"-check",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
"linux": {
"command": "sh",
"args": ["-c"]
},
{
"taskName": "OneScript: make",
"args": [
"-make",
"${file}",
"${fileBasename}.exe"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
},
{
"taskName": "OneScript: run",
"args": [
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "^{Модуль\\s+(.*)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+(.*)}$",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "OneScript-testrunner",
"args": [
"../tests/testrunner.os",
"-run",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "^{Модуль\\s+(.*)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+(.*)}$",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "OneScript-testrunner-all",
"args": [
"../tests/testrunner.os",
"-runall",
"tests"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "^{Модуль\\s+(.*)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+(.*)}$",
"file": 1,
"location": 2,
"message": 3
"isShellCommand": true,
// "showOutput": "silent",
"_runner": "terminal",
"tasks": [
{
"taskName": "Testing project",
"args": [
"1testrunner",
"-runall",
"${workspaceRoot}/tests"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
// "isBuildCommand": false,
"isTestCommand": false,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "Testing current test-file",
"args": [
"1testrunner",
"-run",
"${file}",
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false,
"isTestCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "Exec all features",
"args": [
"1bdd",
"${workspaceRoot}/features",
"-out",
"${workspaceRoot}/exec.log"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": true,
"isTestCommand": false,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "Exec feature",
"args": [
"1bdd",
"${file}",
"-out",
"${workspaceRoot}/exec.log"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false,
"isTestCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": [
{
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
]
}
},
{
"taskName": "Exec feature for current step def",
"args": [
"1bdd",
"${fileDirname}/../${fileBasenameNoExtension}.feature",
"-fail-fast",
"-out",
"${workspaceRoot}/exec.log"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false,
"isTestCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": [
{
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
]
}
},
{
"taskName": "Generate feature steps",
"args": [
"1bdd",
"gen",
"${file}",
"-out",
"${workspaceRoot}/exec.log"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false,
"isTestCommand": false,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
"file": 1,
"location": 2,
"message": 3
}
}
},
{
"taskName": "Opm: package build",
"args": [
"opm",
"build",
"${workspaceRoot}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
},
{
"taskName": "OneScript: compile",
"args": [
"oscript",
"-encoding=utf-8",
"-compile",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
},
{
"taskName": "OneScript: check",
"args": [
"oscript",
"-encoding=utf-8",
"-check",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
},
{
"taskName": "OneScript: make",
"args": [
"oscript",
"-encoding=utf-8",
"-make",
"${file}",
"${fileBasename}.exe"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": false
},
{
"taskName": "OneScript: run",
"args": [
"oscript",
"-encoding=utf-8",
"${file}"
],
"echoCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"isBuildCommand": true,
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "^{Модуль\\s+(.*)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+(.*)}$",
"file": 1,
"location": 2,
"message": 3
}
}
}
}
}
]
]
}
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2017-03-09 ret-Phoenix <dev@itpath.ru>

[added] Запрос.Таймаут/Query.Timeout - Время в секундах, в течение которого должно происходить ожидание выполнения команды. По умолчанию используется значение 30 секунд.
[fixed] Тесты, переделано на "#Использовать sql".
[fixed] Документация, с учетом добавления свойства Таймаут.
10 changes: 9 additions & 1 deletion docs/Запрос.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
Тип значения: Строка

Содержит исходный текст выполняемого запроса.


### Таймаут / Timeout
Доступ: Чтение/Запись

Тип значения: Число

Время в секундах, в течение которого должно происходить ожидание выполнения команды. По умолчанию используется значение 30 секунд.


## Методы

### Выполнить / Execute()
Expand Down
3 changes: 2 additions & 1 deletion examples/sqlite-in-memory.os
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ПодключитьВнешнююКомпоненту(КаталогПрограммы()+"\ext\sql\sql.dll");
#Использовать sql
//ПодключитьВнешнююКомпоненту(КаталогПрограммы()+"\ext\sql\sql.dll");

Соединение = Новый Соединение();
Соединение.ТипСУБД = Соединение.ТипыСУБД.sqlite;
Expand Down
17 changes: 15 additions & 2 deletions oscript-sql/SQLQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,23 @@ public static IRuntimeContextInstance Constructor()
public StructureImpl Parameters
{
get { return _parameters; }
}


/// <summary>
/// Управление таймауотом
/// </summary>
/// <value>Число</value>
[ContextProperty("Таймаут", "Timeout")]
public int Timeout
{
get { return _command.CommandTimeout; }
set
{
_command.CommandTimeout = value;
}
}



/// <summary>
/// Содержит исходный текст выполняемого запроса.
/// </summary>
Expand Down
Loading

0 comments on commit 4889055

Please sign in to comment.