You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, since the execution is lazy and I have been just building an Expression (so to speak, since query is actually of type Table), this query will be optimized and result in the following:
SELECT * FROM itemsTable WHERE id = targetID LIMIT 10;
Which is not what I want. This gets all items matching the targetID and THEN limits those results to 10. My intuition was then to use UNION and just make 2 different queries and find their common result domain. However, as you may know, this library does not offer a UNION operator.
Now, I can obviously use raw SQL, but I'd like to keep it swifty, so to speak. Does anyone have advice on how to meet the result I need using this library (and probably without the use of UNION)?
The text was updated successfully, but these errors were encountered:
Language: Swift 3
Target: iOS 10.0
Pod Version: 0.11.0
xCode: 8.2.1
Hello,
I have in my database a table of items. I am trying to write a query which will let me know if a particular item is in the first "page" of items.
To do so, I need to query the table with a
limit
to get the first "page", so lets say:Next, I need to check if the item I am looking for is in this first page, so my initial reflex was to apply the following:
However, since the execution is lazy and I have been just building an
Expression
(so to speak, sincequery
is actually of typeTable
), this query will be optimized and result in the following:Which is not what I want. This gets all items matching the
targetID
and THEN limits those results to 10. My intuition was then to use UNION and just make 2 different queries and find their common result domain. However, as you may know, this library does not offer a UNION operator.Now, I can obviously use raw SQL, but I'd like to keep it swifty, so to speak. Does anyone have advice on how to meet the result I need using this library (and probably without the use of UNION)?
The text was updated successfully, but these errors were encountered: