Giter Site home page Giter Site logo

closure_table's People

Contributors

50kudos avatar florinpatrascu avatar greg-rychlewski avatar mstibbard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

closure_table's Issues

Ecto adapter fails to accept anything other than integers for IDs

Was attempting to use this in a database that uses :binary_id as the primary ID type on all tables, but it immediately failed.

Mainly due to this line: https://github.com/florinpatrascu/closure_table/blob/main/lib/cte/adapter/ecto.ex#L309

This is the error thrown:

** (Ecto.Query.CastError) deps/closure_table/lib/cte/adapter/ecto.ex:307: value `"f74992a5-2ec4-438c-bfc4-97a31c925d0f"` in `select` cannot be cast to type :integer in query:

Immediate parent or child query

To be able to query immediate parent or child, the simplest way is to add depth (or level or what is your preference) column to tree_paths table

descendants/2 and ancestors/2 will accept a new option called depth (or whatever that matches the new column).

Thanks for making this package, I am evaluating and would love to contribute, but it would be great to hear from author before introducing public data structure breaking change (e.g. change paths to list of map instead.)

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.