-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: specify next release CS Revert "remove ability to use joins when updating or deleting as it is not supported by sqlite" fix support of aliased table when deleting remove sqlite support fix tests fix applying a moreThanOrEqual or lessThanOrEqual when the columns are different
- Loading branch information
Showing
15 changed files
with
365 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/composer.lock | ||
/vendor | ||
/.cache | ||
/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace Properties\Formal\AccessLayer\Connection; | ||
|
||
use Formal\AccessLayer\{ | ||
Query\SQL, | ||
Query, | ||
Table, | ||
Row, | ||
Connection, | ||
}; | ||
use Innmind\BlackBox\{ | ||
Property, | ||
Set, | ||
Runner\Assert, | ||
}; | ||
|
||
/** | ||
* @implements Property<Connection> | ||
*/ | ||
final class DeleteWithAlias implements Property | ||
{ | ||
private string $uuid; | ||
|
||
public function __construct(string $uuid) | ||
{ | ||
$this->uuid = $uuid; | ||
} | ||
|
||
public static function any(): Set | ||
{ | ||
return Set\Uuid::any()->map(static fn($uuid) => new self($uuid)); | ||
} | ||
|
||
public function applicableTo(object $connection): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function ensureHeldBy(Assert $assert, object $connection): object | ||
{ | ||
$select = SQL::of('SELECT * FROM test'); | ||
$connection(Query\Insert::into( | ||
Table\Name::of('test'), | ||
Row::of([ | ||
'id' => $this->uuid, | ||
'username' => 'foo', | ||
'registerNumber' => 42, | ||
]), | ||
)); | ||
|
||
$sequence = $connection(Query\Delete::from( | ||
Table\Name::of('test')->as('alias'), | ||
)); | ||
|
||
$assert->count(0, $sequence); | ||
|
||
$rows = $connection($select); | ||
|
||
$assert->count(0, $rows); | ||
|
||
return $connection; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.