Skip to content

Commit afc3647

Browse files
Crinsanetaylorotwell
authored andcommitted
Added nested transactions support for SqlServer (#19439)
1 parent fa418fb commit afc3647

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php

+23-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,29 @@ public function prepareBindingsForUpdate(array $bindings, array $values)
368368
*/
369369
public function supportsSavepoints()
370370
{
371-
return false;
371+
return true;
372+
}
373+
374+
/**
375+
* Compile the SQL statement to define a savepoint.
376+
*
377+
* @param string $name
378+
* @return string
379+
*/
380+
public function compileSavepoint($name)
381+
{
382+
return 'SAVE TRANSACTION '.$name;
383+
}
384+
385+
/**
386+
* Compile the SQL statement to execute a savepoint rollback.
387+
*
388+
* @param string $name
389+
* @return string
390+
*/
391+
public function compileSavepointRollBack($name)
392+
{
393+
return 'ROLLBACK TRANSACTION '.$name;
372394
}
373395

374396
/**

0 commit comments

Comments
 (0)