New: Add MySQL implementation of UuidValue expression - #482
Open
KalimeroMK wants to merge 3 commits into
Open
Conversation
MySQL and MariaDB store a UUID as 16 raw bytes in a `binary(16)` column, so `prepareValue()` converts the canonical form with `DbUuidHelper::uuidToBlob()` and binds it as `DataType::LOB`. Requires yiisoft/db#1199.
KalimeroMK
force-pushed
the
add-1152-uuid-value
branch
from
September 8, 2026 05:35
35ec6c0 to
6cb41c1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #482 +/- ##
=========================================
Coverage 99.10% 99.10%
- Complexity 256 257 +1
=========================================
Files 24 25 +1
Lines 779 782 +3
=========================================
+ Hits 772 775 +3
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Tigrov
reviewed
Sep 10, 2026
| { | ||
| protected function prepareValue(UuidValue $expression): Param | ||
| { | ||
| return new Param(DbUuidHelper::uuidToBlob($expression->value), DataType::LOB); |
Member
There was a problem hiding this comment.
Will it work when $expression->value is 16 raw bytes or 32 hexadecimal characters? Needs a test
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MySQL/MariaDB half of
UuidValue, added in yiisoft/db#1199 — that PR has to be merged first.Both store a UUID as 16 raw bytes (
ColumnDefinitionBuildermapsColumnType::UUIDtobinary(16)), soprepareValue()converts the canonical form withDbUuidHelper::uuidToBlob()and binds it asDataType::LOBrather than lettingbuildValue()inferDataType::STRING:Verified locally against MySQL 8.4: the round-trip test inserts into a real
binary(16)column and reads back 16 bytes that decode to the original UUID.The branch name matches the one in yiisoft/db#1199, so
install-packagesresolves the core package from it and CI runs against the new class.