Giter VIP home page Giter VIP logo

Comments (6)

AMHOL avatar AMHOL commented on August 17, 2024

Is this your actual use-case? Nested Set Model would probably be a better fit if you need to return a subset of child nodes.

As for the issue, I haven't tested it but try calling #inner_join with something like: inner_join("nodes AS nodes_#{index}")

from rom-sql.

apohllo avatar apohllo commented on August 17, 2024

Yes this is a real use-case. I know the nested set model, but here the scenario is a bit different. Usually one node needs to be selected, which is identified by a composite key, based on parent nodes. Thus the most natural (but not most efficient) way of identifying the node is via path of its parents.

from rom-sql.

AMHOL avatar AMHOL commented on August 17, 2024

OK, cool, did you try the suggested fix at all?

from rom-sql.

apohllo avatar apohllo commented on August 17, 2024

A different error is reported:

PG::UndefinedTable: ERROR:  relation "nodes as nodes_1" does not exist (Sequel::DatabaseError)

from rom-sql.

solnic avatar solnic commented on August 17, 2024

I'm gonna close this one since it is not a bug. It's possible to build a query like that, but using a slightly different approach (I'll try to show how and post it on our forum in the related thread).

from rom-sql.

apohllo avatar apohllo commented on August 17, 2024

Ok, I'm looking forward to see the solution. Thanks.

from rom-sql.

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.