Add guide for time-based sync workarounds#328
Merged
michaelbarnes merged 7 commits intomainfrom Jan 20, 2026
Merged
Conversation
added 2 commits
January 9, 2026 14:11
benitav
reviewed
Jan 9, 2026
benitav
reviewed
Jan 9, 2026
|
|
||
| # The Problem | ||
|
|
||
| Sync rules only support a limited set of operators when filtering on parameters. You can use `=`, `IN`, and `IS NULL`, but not range operators like `>`, `<`, `>=`, or `<=`. |
Collaborator
There was a problem hiding this comment.
I'd add a hyperlink to operators to https://docs.powersync.com/usage/sync-rules/operators-and-functions for more details
benitav
reviewed
Jan 9, 2026
benitav
reviewed
Jan 9, 2026
|
|
||
| This gives users full control over which dates to sync, with no schema changes or scheduled jobs required. | ||
|
|
||
| The trade-off is granularity. In this example we're using daily buckets. If you need finer precision (hourly), syncing a large range means many buckets. If you use larger buckets (monthly), you lose the ability to filter accurately. |
Collaborator
There was a problem hiding this comment.
syncing a large range means many buckets.
It would be good to add why many buckets are a problem. i.e. I assume the main consideration is the 1,000 bucket limit
benitav
reviewed
Jan 9, 2026
| **Cons:** Requires schema changes and scheduled jobs (e.g., pg_cron). Limited to pre-defined time ranges. | ||
| </Warning> | ||
|
|
||
| If you need more flexibility like letting users pick arbitrary date ranges [see Workaround 2](#2:-buckets-per-date). |
Collaborator
There was a problem hiding this comment.
The links here feel a bit weird because they just link to the next line. Feels like we could just say "see the next workaround: Buckets Per Date" or similar
Co-authored-by: benitav <benitav@users.noreply.github.com>
Co-authored-by: benitav <benitav@users.noreply.github.com>
…of bucket granularity.
michaelbarnes
requested changes
Jan 13, 2026
Contributor
michaelbarnes
left a comment
There was a problem hiding this comment.
Minor wording changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents how to implement time-based filtering with current sync rule limitations.
Covers three workarounds:
Highlighted trade-offs for each