Flexible Sync
Flexible Sync lets clients subscribe to queries instead of opening one partition file.
In Barq’s current server, rules are passed as CLI flags.
Enable Flexible Sync
Section titled “Enable Flexible Sync”barq-server-dbg \ --root-dir ./barq-sync-data \ --jwt-public-key ./public.pem \ --enable-flxOwner Rule
Section titled “Owner Rule”--flx-owner-rule Order:owner_idThis allows a user to read and write rows where owner_id equals the token identity.
Public Read-only Rule
Section titled “Public Read-only Rule”--flx-public-readonly-rule CatalogThis allows all users to read Catalog. Only admin can write it.
Example
Section titled “Example”The flexible sync end-to-end example runs with:
--enable-flx --flx-owner-rule Order:owner_id --flx-public-readonly-rule Catalog