Giter VIP home page Giter VIP logo

Comments (4)

zilveer avatar zilveer commented on August 29, 2024 1

@nekufa Perfect, i Will test it again.

Regards

from mapper.

zilveer avatar zilveer commented on August 29, 2024

I have found where the bug is causing the issue,
In Repository.php file line 213-219 there is a code:

foreach ($data as $tuple) {
    $instance = $this->getInstance($tuple);
    if ($one) {
        return $this->results[$cacheKey] = $instance;
    }
    $result[] = $instance;
}

I replaced it with:

foreach ($data as $tuple) {
    echo 'tuple:';
    var_dump($tuple);
    $instance = $this->getInstance($tuple);
    echo 'instance:';
    var_dump($instance);
    echo '<hr>';
    if ($one) {
        return $this->results[$cacheKey] = $instance;
    }
    $result[] = $instance;
}

and it seems to me that the request to $this->getInstance($tuple); is only returning the first row even though the tuple is shown with correct data (test my code and you will see).

EDIT:
I changed getTupleKey to the following code in Space.php:

public function getTupleKey(array $tuple)
{
    $key = [];
    foreach ($this->getPrimaryIndex()['parts'] as $part) {
        echo 'part';
        var_dump($part);
        if(isset($part[0]))
            $key[] = $tuple[$part[0]];
        if(isset($part['field']))
            $key[] = $tuple[$part['field']];
        
    }
    return count($key) == 1 ? $key[0] : implode(':', $key);
}

and now it shows all rows data correct, but it still shows all rows, so probably the function getInstance in file Repository.php needs to be adapted for SQL tables to only return the correct data.

regards Zilveer

from mapper.

nekufa avatar nekufa commented on August 29, 2024

Hello @zilveer, thanks for you feedback!
I found out why sql-based spaces were not working - index format was changed.
This bug was fixed in the latest version, let me know if something else goes wrong.

from mapper.

zilveer avatar zilveer commented on August 29, 2024

Perfect it works good now!

from mapper.

Related Issues (16)

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.