From f2c69f3f050a57ad66526c9b4705699105e3870f Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 31 Oct 2024 15:55:30 +0100 Subject: [PATCH 1/2] Add JSON array explanation --- docs/guides/file_formats/json_export.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/file_formats/json_export.md b/docs/guides/file_formats/json_export.md index e017210bd00..5bf3acfd936 100644 --- a/docs/guides/file_formats/json_export.md +++ b/docs/guides/file_formats/json_export.md @@ -17,4 +17,10 @@ The result of queries can also be directly exported to a JSON file: COPY (SELECT * FROM tbl) TO 'output.json'; ``` +The JSON export writes JSON lines by default. The `ARRAY` option can be used to write a JSON array instead. + +```sql +COPY tbl TO 'output.json' (ARRAY true); +``` + For additional options, see the [`COPY` statement documentation]({% link docs/sql/statements/copy.md %}). From 78194a2cb90edf6f720a0b04c5d1df89192dac5e Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 31 Oct 2024 15:56:45 +0100 Subject: [PATCH 2/2] More succinct --- docs/guides/file_formats/json_export.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/file_formats/json_export.md b/docs/guides/file_formats/json_export.md index 5bf3acfd936..370e1251f57 100644 --- a/docs/guides/file_formats/json_export.md +++ b/docs/guides/file_formats/json_export.md @@ -20,7 +20,7 @@ COPY (SELECT * FROM tbl) TO 'output.json'; The JSON export writes JSON lines by default. The `ARRAY` option can be used to write a JSON array instead. ```sql -COPY tbl TO 'output.json' (ARRAY true); +COPY tbl TO 'output.json' (ARRAY); ``` For additional options, see the [`COPY` statement documentation]({% link docs/sql/statements/copy.md %}).