powersync-ja / powersync-service

Other
123 stars 9 forks source link

Use standard function composition for IN operator #93

Closed rkistner closed 1 month ago

rkistner commented 1 month ago

This allows some additional variations of the IN operator previously not supported:

-- parameter queries
SELECT WHERE request.jwt() ->> 'role' IN '["admin", "superuser"]'
SELECT WHERE 'read:users' IN (request.jwt() ->> 'permissions')
SELECT WHERE 'test' IN '["test"]'

-- data queries
SELECT * FROM assets WHERE assets.condition IN '["good","great"]'
SELECT * FROM assets WHERE 'green' IN assets.categories

This is in addition to the variations already supported before:

-- parameter queries
SELECT id FROM projects WHERE id IN request.jwt() -> 'projects'

-- data queries
SELECT * FROM assets WHERE assets.condition IN '["good","great"]'
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 0e169387720fe4a505c0327e9556badccca23876

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

This PR includes changesets to release 4 packages | Name | Type | | ----------------------------- | ----- | | @powersync/service-sync-rules | Minor | | @powersync/service-core | Patch | | @powersync/service-image | Patch | | test-client | 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