Skip to content
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

Expressions on parameters #30

Merged
merged 25 commits into from
Jul 4, 2024
Merged

Expressions on parameters #30

merged 25 commits into from
Jul 4, 2024

Conversation

rkistner
Copy link
Contributor

@rkistner rkistner commented Jul 3, 2024

This is an initial refactoring to allow some types of expressions on token_parameters and user_parameters.

Examples that this now supports (see tests for more):

SELECT id from users WHERE filter_param = token_parameters.some_param ->> 'description'
SELECT id from users WHERE filter_param = upper(token_parameters.some_param)
SELECT id from projects WHERE page = user_parameters.index + 1

These expressions are only supported for parameter queries, not for bucket parameters in data queries.

Additionally this:

  • Expands test coverage for sync rules.
  • Refactors internal naming to make concepts easier to follow.
  • Adds overview documentation on the implementation.

Copy link

changeset-bot bot commented Jul 3, 2024

🦋 Changeset detected

Latest commit: 6d6a5d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@powersync/service-sync-rules Minor
@powersync/service-core Patch
powersync-open-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rkistner rkistner changed the title [WIP] Expressions on parameters Expressions on parameters Jul 4, 2024
@rkistner rkistner marked this pull request as ready for review July 4, 2024 10:51
@rkistner rkistner requested a review from Chriztiaan July 4, 2024 10:51
@Chriztiaan
Copy link
Contributor

The sync rule readme helps a lot!

@rkistner rkistner merged commit ba613f3 into main Jul 4, 2024
8 checks passed
@rkistner rkistner deleted the client-parameter-functions branch July 4, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants