Originally created by @demonar on GitHub (Apr 2, 2018).
i'm updating the implementation on a project and found that when trying to update the old fashioned where, order, tweak clauses to the new form, i'm not allowed, but on the monitorList method i still can, this leaves a mix of styles in the code, if i were to parametrize some of the clauses to recall them i couldn't as they're not compatible, is there a way to add this in the future?
Originally created by @demonar on GitHub (Apr 2, 2018).
i'm updating the implementation on a project and found that when trying to update the old fashioned where, order, tweak clauses to the new form, i'm not allowed, but on the monitorList method i still can, this leaves a mix of styles in the code, if i were to parametrize some of the clauses to recall them i couldn't as they're not compatible, is there a way to add this in the future?
adam
added the wontfix label 2025-12-29 15:26:34 +01:00
as you can see i need to do it the old fashioned way as the refetch method does not allow the chain builder
@demonar commented on GitHub (Apr 15, 2018):
lets say i have this monitor:
` typealias ListEntityType = SomeEntity`
` let monitor = appStack.dataStack.monitorList(`
` From<ListEntityType>()`
` .where(\.someProperty == false &&`
` \.someOtherProperty == true &&`
` \.someMoreProperty == myValue ?? "")`
` .orderBy(.descending(\.created), .descending(\.elementId))`
` .tweak { $0.fetchBatchSize = 20 })`
and after an update i need to refetch:
` self.monitor.refetch(Where<ListEntityType>("someProperty", isEqualTo: false) &&`
` Where<ListEntityType>("someOtherProperty", isEqualTo: true) &&`
` Where<ListEntityType>("someMoreProperty", isEqualTo: otherElement.name),`
` OrderBy<ListEntityType>(.descending("created"), .descending("elementId")),`
` Tweak { $0.fetchBatchSize = 20 })`
as you can see i need to do it the old fashioned way as the refetch method does not allow the chain builder
It's been many months and I apologize that this issue got buried. Looking back into refetch(), it's not really compatible with fetch builders because of it's special nature:
It replaces only the FetchClause that you specify, which means it keeps the old clauses for those you didn't specify
It only accepts Where, OrderBy, and Tweak clauses.
Due to these the current refetch() API being "old fashioned" is by design.
@JohnEstropia commented on GitHub (Dec 5, 2018):
It's been many months and I apologize that this issue got buried. Looking back into `refetch()`, it's not really compatible with fetch builders because of it's special nature:
1. It replaces only the `FetchClause` that you specify, which means it keeps the old clauses for those you didn't specify
2. It only accepts `Where`, `OrderBy`, and `Tweak` clauses.
Due to these the current `refetch()` API being "old fashioned" is by design.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @demonar on GitHub (Apr 2, 2018).
i'm updating the implementation on a project and found that when trying to update the old fashioned where, order, tweak clauses to the new form, i'm not allowed, but on the monitorList method i still can, this leaves a mix of styles in the code, if i were to parametrize some of the clauses to recall them i couldn't as they're not compatible, is there a way to add this in the future?
@JohnEstropia commented on GitHub (Apr 14, 2018):
@demonar Hi, can you give more information on what you tried that didn't work?
@demonar commented on GitHub (Apr 15, 2018):
lets say i have this monitor:
typealias ListEntityType = SomeEntitylet monitor = appStack.dataStack.monitorList(From<ListEntityType>().where(\.someProperty == false &&\.someOtherProperty == true &&\.someMoreProperty == myValue ?? "").orderBy(.descending(\.created), .descending(\.elementId)).tweak { $0.fetchBatchSize = 20 })and after an update i need to refetch:
self.monitor.refetch(Where<ListEntityType>("someProperty", isEqualTo: false) &&Where<ListEntityType>("someOtherProperty", isEqualTo: true) &&Where<ListEntityType>("someMoreProperty", isEqualTo: otherElement.name),OrderBy<ListEntityType>(.descending("created"), .descending("elementId")),Tweak { $0.fetchBatchSize = 20 })as you can see i need to do it the old fashioned way as the refetch method does not allow the chain builder
@JohnEstropia commented on GitHub (Dec 5, 2018):
It's been many months and I apologize that this issue got buried. Looking back into
refetch(), it's not really compatible with fetch builders because of it's special nature:FetchClausethat you specify, which means it keeps the old clauses for those you didn't specifyWhere,OrderBy, andTweakclauses.Due to these the current
refetch()API being "old fashioned" is by design.