Code Monkey home page Code Monkey logo

Comments (5)

ramsey avatar ramsey commented on June 20, 2024

Is the value returned from Postgres a resource?

from uuid-doctrine.

llupa avatar llupa commented on June 20, 2024

I cannot tell with certainty if that is the case, I will check or make a poc for the issue. Sorry for the delayed reply, I have been traveling.

from uuid-doctrine.

llupa avatar llupa commented on June 20, 2024

Updates 😄 , finally.

So I tried to reproduce my own report and I was failing at it. Most of the blame is on me, because while trying to debug this I changed so many things to "make it work", that I was convinced that my original report above reflected the truth.

I followed the README of this project and just adapted to PSQL if necessary. Originally the project was using uuid_binary. The result was what I have mentioned above. At some point I changed from uuid_binary to uuid and it still did not work. Unbeknownst to me at that time was that, of course it did not work, I had old data in my DB.

The is_resource did handle my now mixed data DB.

This seems to be a specific issue when you combine a DB such as posgre and uuid_binary. I made a little POC project here and here you can see the output of a small workflow, step: Proof maybe?.

This is kind of a bug? I think README can be updated to make it more clear which type to use with which which platform, instead of having a comment hidden in a closed issue from 2018.

Additionally the UuidBinary could also do a platform check and throw an incompatible exception?

public function convertToPHPValue($value, AbstractPlatform $platform): ?UuidInterface
{
    if ($platform instanceof PostgreSQLPlatform) {
        throw new IncompatibleTypeAndPlatformException;
    }
        
    // ...
}

Happy to help with either 👍

from uuid-doctrine.

jankal avatar jankal commented on June 20, 2024

I faced the same issue triggering the following error:

The given entity of type [...] ([...]@999) has no identity/no id values set. It cannot be added to the identity map.

I'm on PHP 8.2.12 with PostgreSQL 15.3

Adding the resource handling fixed my issue:

if (is_resource($value)) {
    $value = stream_get_contents($value);
}

I am in favor of introducing resource handling for PostgreSQL and have submitted a PR #229.

from uuid-doctrine.

jankal avatar jankal commented on June 20, 2024

I created #230 to add clarify optimal use with PostgreSQL.

from uuid-doctrine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.