|
17 | 17 | use MongoDB\Laravel\Connection as MongoDbConnection;
|
18 | 18 | use PDO;
|
19 | 19 | use PHPUnit\Framework\Attributes\DataProvider;
|
| 20 | +use SingleStore\Laravel\Connect\Connection as LegacySingleStoreConnection; |
| 21 | +use SingleStore\Laravel\Connect\SingleStoreConnection; |
20 | 22 | use Tests\TestCase;
|
21 | 23 |
|
22 | 24 | use function base64_encode;
|
@@ -207,6 +209,15 @@ public static function whereInQueries(): iterable
|
207 | 209 | new SqlServerConnection('test', config: ['name' => 'foo', 'driver' => 'sqlsrv']),
|
208 | 210 | ];
|
209 | 211 |
|
| 212 | + yield 'singlestore' => [ |
| 213 | + 'select * from `users` where `users`.`id` in (1, 2, 3) and `id` in (?, ?, ?)', |
| 214 | + hash('xxh128', 'foo,select * from `users` where `users`.`id` in (...?) and `id` in (...?)'), |
| 215 | + match (true) { |
| 216 | + class_exists(SingleStoreConnection::class) => new SingleStoreConnection('test', config: ['name' => 'foo', 'driver' => 'singlestore']), |
| 217 | + class_exists(LegacySingleStoreConnection::class) => new LegacySingleStoreConnection('test', config: ['name' => 'foo', 'driver' => 'singlestore']), |
| 218 | + }, |
| 219 | + ]; |
| 220 | + |
210 | 221 | yield 'mongodb' => [
|
211 | 222 | 'some mongo query in (1, 2, 3) and [id] in (?, ?, ?)',
|
212 | 223 | hash('xxh128', 'foo,some mongo query in (1, 2, 3) and [id] in (?, ?, ?)'),
|
@@ -276,6 +287,15 @@ public static function insertQueries(): iterable
|
276 | 287 | new SqlServerConnection('test', config: ['name' => 'foo', 'driver' => 'sqlsrv']),
|
277 | 288 | ];
|
278 | 289 |
|
| 290 | + yield 'singlestore' => [ |
| 291 | + 'insert into `users` (`id`, `name`) values (?, ?)', |
| 292 | + hash('xxh128', 'foo,insert into `users` (`id`, `name`) values ...'), |
| 293 | + match (true) { |
| 294 | + class_exists(SingleStoreConnection::class) => new SingleStoreConnection('test', config: ['name' => 'foo', 'driver' => 'singlestore']), |
| 295 | + class_exists(LegacySingleStoreConnection::class) => new LegacySingleStoreConnection('test', config: ['name' => 'foo', 'driver' => 'singlestore']), |
| 296 | + }, |
| 297 | + ]; |
| 298 | + |
279 | 299 | yield 'mongodb' => [
|
280 | 300 | 'insert some mongo query values (?, ?), (?, ?)',
|
281 | 301 | hash('xxh128', 'foo,insert some mongo query values (?, ?), (?, ?)'),
|
|
0 commit comments