-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support dynamically adding tables in schema at runtime #332
Comments
The schema is not related to what data is being downloaded. I'd recommend to always have both tables in the schema, and use client parameters to control what is being synced. |
@rkistner thanks for the quick reply.
When I want to change the param load_pack_a, I must disconnect and then connect again?
|
If the parameters change, you can just call The current architecture is not compatible with lazy-loading parts of your schema in the same database - I'd recommend defining your schema in a single module instead, containing all the features. If you do really want independent features, one approach is to use a completely separate PowerSyncDatabase for each. In that case, you would have a separate database and a separate connection per feature, and each of these connections will count towards your "peak concurrent connections" limit. |
@rkistner do you have any example code about lazy loading with client parameters? |
We're working on some example code, should be available next week. |
hi @rkistner @kobiebotha how is it going? |
+1 |
@nthtrung09it @amjadbouhouch Apologies for the delay. We now have an example with sync rules here: The specific example is for having different "priorities" for synced data, but the same could apply for lazy-loading different sets of data. |
Hi @rkistner, do you have example code for the prioritized-sync and lazy load? |
Imagine that I have two tables: pack_a and pack_b.
In my application, I only want to fetch the items of pack_a when user enters the feature A, and only fetch the items of pack_b when user enters the feature B. For now, when my app launched and logged in, all items of pack_a and pack_b have been downloaded into my sqlite.
How can I do it? Do you have a mechanism that dynamically adds tables into schema.
The text was updated successfully, but these errors were encountered: