From 3e059d1edc98c2c4d27def2b3c5eae2f371332a0 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 1 Nov 2024 23:33:08 +1100 Subject: [PATCH] Update derivations.md with select JSON($flow_document) (#1747) Adding use of `JSON($flow_document)` for selecting all input parameters in a derivation, as per https://estuaryworkspace.slack.com/archives/C03Q9A3GFEE/p1729516762991479 --- site/docs/concepts/derivations.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/docs/concepts/derivations.md b/site/docs/concepts/derivations.md index 37aa04c22a..1714de71e1 100644 --- a/site/docs/concepts/derivations.md +++ b/site/docs/concepts/derivations.md @@ -218,6 +218,10 @@ into JSON arrays or objects and embeds them into the mapped document: `{"greeting": "hello", "items": [1, "two", 3]}`. If parsing fails, the raw string is used instead. +If you would like to select all columns of the input collection, +rather than `select *`, use `select JSON($flow_document)`, e.g. +`select JSON($flow_document where $status = open;`. + As a special case if your query selects a _single_ column having a name that begins with `json` or `JSON`, as is common when working with SQLite's [JSON functions](https://www.sqlite.org/json1.html),