How does persister.load and persister.autoLoad work with persister-expo-sqlite? #141
-
Hello, I'm trying to work out how persister.load and persister.autoLoad works with persister-expo-sqlite. When running persister.load does it get the entire tables content and load that into the store or does it only load in to the store the results of queries made so far? Also when persister.autoLoad triggers does it get the entire tables content and load that into the store or does is load in to the store the results of what was just queried? My hope is that it loads to the store only what is queried. That way tinybase stays performant even with very large database tables. Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If I understand your question (i.e. when you say 'queries made so far' you mean TinyBase getters) then no. TinyBase is an in-memory data store and at the moment persists (ie loads and saves) all data to and from a database. There's no sense of paging, and I wouldn't currently recommend connecting to a large underlying table that has way more data than you need (for obvious reasons). This has come up a few times, so I think we should explore a better way to only persist to/from just a part of a table (eg filtered on values, IDs). I can't get to this in v5, but I will roadmap. |
Beta Was this translation helpful? Give feedback.
If I understand your question (i.e. when you say 'queries made so far' you mean TinyBase getters) then no. TinyBase is an in-memory data store and at the moment persists (ie loads and saves) all data to and from a database. There's no sense of paging, and I wouldn't currently recommend connecting to a large underlying table that has way more data than you need (for obvious reasons).
This has come up a few times, so I think we should explore a better way to only persist to/from just a part of a table (eg filtered on values, IDs). I can't get to this in v5, but I will roadmap.