New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How would you use GRDBQuery on large data #10
Comments
Hello @fbertuzzi, The publisher of your If the definition of "currently needed" changes over time, you can modify the query at runtime. As an inspiration, check this demo app: it changes the ordering of the list fetched by its |
Hey @groue, thank you for the fast reply! I’ll definitely have a look into the demo app. With „currently needed“ I mean which messages are currently in view + some additional ones so the user won’t notice that much of a loading time. If I change my array of messages while scrolling, wouldn’t that mess up my scrollview position as the user is scrolling from the bottom up? |
Your question is about the behavior of SwiftUI lists and stacks regarding lists that vary according to pagination or other techniques. This repository is not quite the place to ask such question, I'm sorry. I do wish I had a ready-made answer, but I have not! |
I had to close the issue since it is not related to But I can give an advice: maybe do not try to tackle all problems at the same time. I'd explore the subject of varying lists first, without any database or Only then, when I have a clear understanding of the data I need, and how to ask SwiftUI to display it, I'd plug Feel free to share your conclusions! This may help other users in the future! |
Hey,
I'm currently working on a Chat App and using GRDBQuery for data loading from GRDB.
How would you use GRDBQuery for loading chat message?
Currently I'm fetching all messages which starts to cause large loading times and memory usage as it's all getting fetched at once.
The messages are displayed in a ScrollView which embeds a LazyVStack.
How would I use GRDBQuery for fetching just the messages currently needed, but keep the immediate loading GRDBQuery offers.
Is that possible?
The text was updated successfully, but these errors were encountered: