Skip to content

Commit

Permalink
Fix Sqlite uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Dec 1, 2024
1 parent e4b2c3f commit a56fb1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Common/CommonColumnSchemaBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Yiisoft\Db\Tests\Common;

use PHPUnit\Framework\TestCase;
use Yiisoft\Db\Command\DataType;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\Expression\Expression;
Expand Down Expand Up @@ -48,7 +50,7 @@ public function testUuid(): void
$uuidValue = match ($db->getDriverName()) {
'oci' => new Expression("HEXTORAW(REPLACE(:uuid, '-', ''))", [':uuid' => $uuidValue]),
'mysql' => new Expression("UNHEX(REPLACE(:uuid, '-', ''))", [':uuid' => $uuidValue]),
'sqlite' => new Expression("UNHEX(REPLACE(:uuid, '-', ''))", [':uuid' => $uuidValue]),
'sqlite' => new Param(DbUuidHelper::uuidToBlob($uuidValue), DataType::LOB),
'sqlsrv' => new Expression('CONVERT(uniqueidentifier, :uuid)', [':uuid' => $uuidValue]),
default => $uuidValue,
};
Expand Down

0 comments on commit a56fb1f

Please sign in to comment.