-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add Query\Builder::whereInEmbedded #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
use Google\Cloud\Spanner\Duration; | ||
use Illuminate\Database\Events\QueryExecuted; | ||
use Illuminate\Database\QueryException; | ||
use Illuminate\Support\Arr; | ||
use Illuminate\Support\Carbon; | ||
use LogicException; | ||
|
||
|
@@ -850,6 +851,20 @@ public function test_whereIn(): void | |
$this->assertSame(2, $conn->table($tableName)->whereIn('bytesTest', [new Bytes(chr(10)), new Bytes(chr(20))])->count()); | ||
} | ||
|
||
public function test_whereInEmbedded_can_do_more_than_950_parameters(): void | ||
{ | ||
$conn = $this->getDefaultConnection(); | ||
$tableName = self::TABLE_NAME_USER; | ||
$qb = $conn->table($tableName); | ||
$id1 = $this->generateUuid(); | ||
$id2 = $this->generateUuid(); | ||
$dummyIds = array_map($this->generateUuid(...), range(0, 950)); | ||
|
||
$qb->insert([['userId' => $id1, 'name' => 't1'], ['userId' => $id2, 'name' => 't2']]); | ||
$ids = $qb->whereInEmbedded('userId', [$id1, $id2, ...$dummyIds])->pluck('userId'); | ||
$this->assertEquals([$id1, $id2], $ids->all()); | ||
} | ||
Comment on lines
+854
to
+866
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding more robust assertions to ensure the correctness of The test verifies that the IDs match, but it could be enhanced by checking that no additional IDs are returned and that the exact expected IDs are present in the correct order. This would make the test more robust against potential modifications that could alter the behavior of |
||
|
||
public function test_partitionedDml(): void | ||
{ | ||
$conn = $this->getDefaultConnection(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.