Skip to content

Commit f9bde15

Browse files
committed
Patch-A
1 parent 3f8b0a9 commit f9bde15

File tree

16 files changed

+171
-21
lines changed

16 files changed

+171
-21
lines changed
1.27 KB
Loading

develnext-bundles/dn-sql-bundle/src/vendor/develnext.bundle.sql.SqlBundle/bundle/sql/SqlClient.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ abstract class SqlClient extends AbstractScript
3434
*/
3535
public $catchErrors = true;
3636

37+
/**
38+
* @var int
39+
*/
40+
public $transactionIsolation = 0;
41+
3742
/**
3843
* @return SqlConnection
3944
*/
@@ -58,6 +63,8 @@ public function open()
5863
{
5964
if (!$this->isOpened()) {
6065
$this->client = $this->buildClient();
66+
$this->client->transactionIsolation = $this->getTransactionIsolation();
67+
6168
$this->closed = false;
6269
$this->trigger('open');
6370
}
@@ -129,6 +136,66 @@ public function rollback()
129136
$this->client->rollback();
130137
}
131138

139+
/**
140+
* @param string $name
141+
* @return string
142+
*
143+
* @throws SqlException
144+
*/
145+
public function identifier($name)
146+
{
147+
return $this->client->identifier($name);
148+
}
149+
150+
/**
151+
* See SqlConnection::TRANSACTION_* constants.
152+
*
153+
* @return int
154+
*/
155+
public function getTransactionIsolation()
156+
{
157+
return $this->transactionIsolation;
158+
}
159+
160+
/**
161+
* @param int $value
162+
*/
163+
public function setTransactionIsolation($value)
164+
{
165+
$this->transactionIsolation = $value;
166+
167+
if ($this->client) {
168+
$this->client->transactionIsolation = $value;
169+
}
170+
}
171+
172+
/**
173+
* @non-getter
174+
* @return array
175+
*/
176+
public function getCatalogs()
177+
{
178+
return $this->client->getCatalogs();
179+
}
180+
181+
/**
182+
* @non-getter
183+
* @return array
184+
*/
185+
public function getMetaData()
186+
{
187+
return $this->client->getMetaData();
188+
}
189+
190+
/**
191+
* @non-getter
192+
* @return array
193+
*/
194+
public function getSchemas()
195+
{
196+
return $this->client->getSchemas();
197+
}
198+
132199
public function __destruct()
133200
{
134201
if ($this->isOpened()) {

develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/SqliteBundle.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ function getName()
2020

2121
function getDescription()
2222
{
23-
return "Пакет для работы с базой данных SQLite";
23+
return "Пакет для работы с базой данных SQLite 3";
2424
}
2525

26-
2726
public function isAvailable(Project $project)
2827
{
2928
return true;

develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteClientComponent.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33
<property code="file" value="example.db" />
44
<property code="autoOpen" value="1" />
55
<property code="catchErrors" value="1" />
6+
<property code="transactionIsolation" value="8" />
67
</init>
78

89
<properties group="general">
910
<property code="file" name="Файл" editor="text" tooltip="Относительный или полный путь к файлу, значение :memory: для базы в памяти." />
1011
<property code="autoOpen" name="Авто-открытие" editor="boolean" tooltip="Автоматически открывать базу при смене источника" />
1112
<property code="options" name="Опции" editor="text" tooltip="Список опций, каждая опция на отдельной строке, формат как name=value" />
1213
<property code="catchErrors" name="Игнорировать ошибки" editor="boolean" tooltip="Если опция включения, компонент не будет кидать исключения Exception" />
14+
<property code="transactionIsolation" name="Тип транзакций" editor="enum" tooltip="Тип изоляции транзакций">
15+
<variants>
16+
<variant value="0">NONE</variant>
17+
<variant value="1">READ_UNCOMMITTED</variant>
18+
<variant value="2">READ_COMMITTED</variant>
19+
<variant value="4">REPEATABLE_READ</variant>
20+
<variant value="8">SERIALIZABLE</variant>
21+
</variants>
22+
</property>
1323
</properties>
1424

1525
<eventTypes>

develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteStorageComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function getName()
2222

2323
public function getIcon()
2424
{
25-
return 'develnext/bundle/sql/storage16.png';
25+
return 'develnext/bundle/sql/sdMemory16.png';
2626
}
2727

2828
public function getIdPattern()

develnext-bundles/dn-sqlite-bundle/src/vendor/develnext.bundle.sql.SqliteBundle/bundle/sql/SqliteClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class SqliteClient extends SqlClient
2222
*/
2323
public $options = [];
2424

25+
function __construct()
26+
{
27+
$this->setTransactionIsolation(SqlConnection::TRANSACTION_SERIALIZABLE);
28+
}
29+
2530
/**
2631
* @return SqlConnection
2732
*/

develnext/misc/history.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Patch-A
1212
- Исправлена проблема, когда css стиль проекта применялся не ко всем компонентам в редакторе форм.
1313
- Исправлен баг с неверными подсказками для класса Mouse.
1414
- Доработано автодополнение для переменных и для определения их типа.
15-
- Исправлен баг singleton модулей, она создавались дважды в некоторых случаях.
15+
- Исправлен баг singleton модулей, они создавались дважды в некоторых случаях.
16+
- Добавлена возможность кешировать сцены не уничтожая их в поведении "Игровая сцена".
1617

1718
Beta-3
1819
------------
1.31 KB
Binary file not shown.
-46 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)