Skip to content

Commit

Permalink
fixup! feat(database): add trait to implement nested transactions via…
Browse files Browse the repository at this point in the history
… savepoints
  • Loading branch information
mkuettel committed Apr 29, 2024
1 parent b044e1b commit 82c06cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions system/Database/SavepointsForNestedTransactions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* This file is part of CodeIgniter 4 framework.
*
Expand All @@ -16,12 +18,12 @@ trait SavepointsForNestedTransactions
/**
* Generates the SQL for managing savepoints, which
* are used to support nested transactions with SQLite3
*
* @param mixed $savepoint
*/
private function _savepoint($savepoint, string $action = ''): string
private function _savepoint(int $savepoint, string $action = ''): string
{
return ($action === '' ? '' : $action . ' ') . 'SAVEPOINT `__ci4_' . $savepoint . '`';
$savepointIdentifier = $this->escapeIdentifier('__ci4_savepoint_' . $savepoint . '__');

return ($action === '' ? '' : $action . ' ') . 'SAVEPOINT ' . $savepointIdentifier;
}

/**
Expand Down

0 comments on commit 82c06cd

Please sign in to comment.