-
|
I want to filter a table to get all rows where columnA = value1 OR columnB = value2 . Is there a way to do that without creating intermediate tables? (first If not, don't worry about trying to implement it, because I think that complex queries should generally make use of an actual database instead of just rye tables. Just wondering. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi. Hm ... I pretty sure I made a "where" built-in and it accepted a code block and returned rows that code returnd true. But I don't see it now. It's also in the cookbook page: https://ryelang.org/cookbook/working-with/tables/ But it accepted only one column. For your case we would need something like where\many { 'colA 'colB } { colA = val1 |or colB = val2 } I will add both in next release. But since it needs to evaluate rye code for each row I'm not sure if will befaster or slower than two consecutive where-* calls. |
Beta Was this translation helpful? Give feedback.
Hi. Hm ... I pretty sure I made a "where" built-in and it accepted a code block and returned rows that code returnd true. But I don't see it now. It's also in the cookbook page: https://ryelang.org/cookbook/working-with/tables/
But it accepted only one column. For your case we would need something like where\many { 'colA 'colB } { colA = val1 |or colB = val2 }
I will add both in next release. But since it needs to evaluate rye code for each row I'm not sure if will befaster or slower than two consecutive where-* calls.