Comments (4)
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.
Thanks @ocharles for the answer.
I hoped there would be a way without ending in the Query
monad
from rel8.
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.
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)
- Allow hedgehog 1.2 in test suite HOT 4
- rel8 1.4.0.0 does not build with opaleye 0.9.7.0 HOT 2
- Use `ilike` with newtype around `Text`
- How to filter `ListTable`? HOT 1
- instance for `Rel8able (Generically1 t)`
- compile times are extremely high HOT 2
- [Feature Request] Generate tests that can check against an actual postgres schema HOT 5
- [Question] What does the `NonEmpty String` list contain in `namesFromLabelsWith`? HOT 1
- Release a version compatible with `opaleye-0.10.2.0` HOT 1
- Rel8 Performance x100 Slower than SQL HOT 8
- Provide access to rel8 internals
- New Hackage release? HOT 3
- Using `DBEnum` with a newtype wrapper HOT 1
- Rel8able records make app slow to start up HOT 1
- Allow `exists` to be used within expressions
- Replace `CalendarDiffTime` with a more useful type, like `NominalDiffTime`
- Boolean comparison operators have confusing/incorrect documentation
- Improve documentation showing how different TableSchemas relates to an actual sql schema
- Gradual shift from Opaleye? HOT 1
- Bad escaping of lambdas in Haddocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rel8.