Giter Site home page Giter Site logo

Comments (4)

ocharles avatar ocharles commented on August 15, 2024

Your best option is probably going to be using catListTable to convert a ListTable to a Query of all of its rows, and then using exists to test if the given row is in the list. This won't quite be the type you want, as this will pull you into the Query monad. I'd also warn that this is likely to have quite poor performance (I doubt PostgreSQL will be able to use an index, for example), but I may be wrong!

from rel8.

marcosh avatar marcosh commented on August 15, 2024

Thanks @ocharles for the answer.

I hoped there would be a way without ending in the Query monad

from rel8.

ocharles avatar ocharles commented on August 15, 2024

Unfortunately it will probably be quite difficult, due to what ListTable actual means in terms of a query. If you have a table T with n columns, then a ListTable T is a table with n columns, but each column is a PostgreSQL array. To see if a row is in a list table means you have to check each of these n arrays contains the respective column from the row you're looking up and that all elements have the same index. It's certainly doable, but I'm not sure it can be done with the Rel8 API at the moment.

from rel8.

marcosh avatar marcosh commented on August 15, 2024

I see, thanks for the clarification. For the moment I'm doing it at the Haskell level instead of at the database level. Not super performant, but it makes things easier at least

from rel8.

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.