From 101277ddbb80ccdd4c21a19683a2b9652c76ce09 Mon Sep 17 00:00:00 2001 From: Dean Braun <72529945+bean1352@users.noreply.github.com> Date: Thu, 4 Jun 2026 15:10:20 +0200 Subject: [PATCH] sync-config: add composite-key JOIN pattern (powersync-docs#395) --- skills/powersync/references/sync-config.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/skills/powersync/references/sync-config.md b/skills/powersync/references/sync-config.md index b42569a..08f870c 100644 --- a/skills/powersync/references/sync-config.md +++ b/skills/powersync/references/sync-config.md @@ -218,6 +218,19 @@ streams: WHERE tm.user_id = auth.user_id() ``` +For composite-key joins (multiple join columns), use implicit join syntax with multiple `WHERE` equality conditions: + +```yaml +streams: + regional_comments: + query: | + SELECT comments.* + FROM comments, issues + WHERE comments.issue_id = issues.id + AND comments.region = issues.region + AND issues.user_id = auth.user_id() +``` + ### Subquery Use `WHERE id IN (SELECT ...)` for indirect access through a related table: @@ -397,7 +410,7 @@ There are examples available for each PowerSync Client SDK. ### Frameworks | Framework | Client Usage Reference URL | -|---------------------------|--------------------------------------------------------------------------------------------------------------------| +|---------------------------|-----------------------------------------------------------------------------------------------------------------| | React | [Client Usage](https://docs.powersync.com/sync/streams/client-usage.md#react-hooks) | ## Advanced Topics