ramsey / uuid-doctrine

:snowflake::file_cabinet: Allow the use of a ramsey/uuid UUID as Doctrine field type.
MIT License
892 stars 84 forks source link

Handle PostgreSQL binary resources #229

Closed jankal closed 3 months ago

jankal commented 9 months ago

Description

PostgreSQL (PDO) returns binary values as resources. Converting those to UUIDs is possible with this change.

Motivation and context

Fixes https://github.com/ramsey/uuid-doctrine/issues/225 where the uuid_binary type was unusable with PostgreSQL.

How has this been tested?

Added 1 new unit test, cross-checked with MySQL 8 and MariaDB 10.

Types of changes

PR checklist

thePanz commented 7 months ago

Thanks for the PR @jankal , this solves the issue!

Any updates on this PR @ramsey ?

ramsey commented 7 months ago

Thanks for the reminder, @thePanz. I'll try to take a look very soon.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.38%. Comparing base (61ce825) to head (956bcf3).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ramsey/uuid-doctrine/pull/229/graphs/tree.svg?width=650&height=150&src=pr&token=FVm8VB6YS1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey)](https://app.codecov.io/gh/ramsey/uuid-doctrine/pull/229?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey) ```diff @@ Coverage Diff @@ ## main #229 +/- ## ============================================ + Coverage 90.25% 90.38% +0.12% - Complexity 75 76 +1 ============================================ Files 7 7 Lines 154 156 +2 ============================================ + Hits 139 141 +2 Misses 15 15 ``` | [Files](https://app.codecov.io/gh/ramsey/uuid-doctrine/pull/229?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey) | Coverage Δ | | |---|---|---| | [src/UuidBinaryType.php](https://app.codecov.io/gh/ramsey/uuid-doctrine/pull/229?src=pr&el=tree&filepath=src%2FUuidBinaryType.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey#diff-c3JjL1V1aWRCaW5hcnlUeXBlLnBocA==) | `87.87% <100.00%> (+0.78%)` | :arrow_up: |
ramsey commented 3 months ago

Sorry for the delay. Thank you for contributing! 🎉