From 38bde67ef4cb14a01d9c93e55bb1c0659eb3bd8b Mon Sep 17 00:00:00 2001 From: Tishj Date: Wed, 11 Sep 2024 16:06:05 +0200 Subject: [PATCH 1/7] create pages + railroad diagrams for LOAD and INSTALL --- docs/sql/statements/install.md | 25 ++++++++++++++++++++++ docs/sql/statements/load.md | 25 ++++++++++++++++++++++ js/statements/install.js | 39 ++++++++++++++++++++++++++++++++++ js/statements/load.js | 21 ++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 docs/sql/statements/install.md create mode 100644 docs/sql/statements/load.md create mode 100644 js/statements/install.js create mode 100644 js/statements/load.js diff --git a/docs/sql/statements/install.md b/docs/sql/statements/install.md new file mode 100644 index 00000000000..ed6414664a7 --- /dev/null +++ b/docs/sql/statements/install.md @@ -0,0 +1,25 @@ +--- +layout: docu +title: INSTALL Statement +railroad: statements/install.js +--- + +The `INSTALL` statement downloads an extension so it can be [loaded]({% link docs/sql/statements/load.md %}) into a duckdb session. + +## Examples + +Install the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: + +```sql +INSTALL httpfs; +``` + +Install the h3 [community extension]({% link docs/extensions/community_extensions.md %}): + +```sql +INSTALL h3 from community; +``` + +## Syntax + +
diff --git a/docs/sql/statements/load.md b/docs/sql/statements/load.md new file mode 100644 index 00000000000..6d30f307a4c --- /dev/null +++ b/docs/sql/statements/load.md @@ -0,0 +1,25 @@ +--- +layout: docu +title: LOAD Statement +railroad: statements/load.js +--- + +The `LOAD` statement loads an installed duckdb extension into the current session. + +## Examples + +Load the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: + +```sql +LOAD httpfs; +``` + +Load the [`spatial`]({% link docs/extensions/spatial.md %}) extension: + +```sql +LOAD spatial; +``` + +## Syntax + +
diff --git a/js/statements/install.js b/js/statements/install.js new file mode 100644 index 00000000000..36a2634596f --- /dev/null +++ b/js/statements/install.js @@ -0,0 +1,39 @@ +function GenerateInstall(options = {}) { + return Diagram([ + AutomaticStack([ + Optional(Keyword("FORCE"), "skip"), + Keyword("INSTALL"), + Expression("extension-name"), + Optional( + Sequence([ + Keyword("FROM"), + Choice(0, [ + Expression("repository"), + Expression("'repository-url'") + ]), + ]), + "skip" + ), + Optional( + Sequence([ + Keyword("VERSION"), + Expression("version-number") + ]), + "skip" + ) + ]) + ]) +} + +function Initialize(options = {}) { + document.getElementById("rrdiagram1").classList.add("limit-width"); + document.getElementById("rrdiagram1").innerHTML = GenerateInstall(options).toString(); +} + +function Refresh(node_name, set_node) { + options[node_name] = set_node; + Initialize(options); +} + +options = {} +Initialize() diff --git a/js/statements/load.js b/js/statements/load.js new file mode 100644 index 00000000000..02d7a758ea1 --- /dev/null +++ b/js/statements/load.js @@ -0,0 +1,21 @@ +function GenerateLoad(options = {}) { + return Diagram([ + AutomaticStack([ + Keyword("LOAD"), + Expression("extension-name") + ]) + ]) +} + +function Initialize(options = {}) { + document.getElementById("rrdiagram1").classList.add("limit-width"); + document.getElementById("rrdiagram1").innerHTML = GenerateLoad(options).toString(); +} + +function Refresh(node_name, set_node) { + options[node_name] = set_node; + Initialize(options); +} + +options = {} +Initialize() From 71bae7b944b4af3fbc6befb2d19b9af9c57e2579 Mon Sep 17 00:00:00 2001 From: Tishj Date: Wed, 11 Sep 2024 16:15:22 +0200 Subject: [PATCH 2/7] merge install and load into a single page --- _data/menu_docs_dev.json | 4 ++ docs/sql/statements/install.md | 25 ---------- docs/sql/statements/load.md | 25 ---------- docs/sql/statements/load_and_install.md | 49 +++++++++++++++++++ js/statements/load.js | 21 -------- .../{install.js => load_and_install.js} | 14 +++++- 6 files changed, 66 insertions(+), 72 deletions(-) delete mode 100644 docs/sql/statements/install.md delete mode 100644 docs/sql/statements/load.md create mode 100644 docs/sql/statements/load_and_install.md delete mode 100644 js/statements/load.js rename js/statements/{install.js => load_and_install.js} (71%) diff --git a/_data/menu_docs_dev.json b/_data/menu_docs_dev.json index b4922eb0834..f277e875603 100644 --- a/_data/menu_docs_dev.json +++ b/_data/menu_docs_dev.json @@ -520,6 +520,10 @@ { "page": "VACUUM", "url": "vacuum" + }, + { + "page": "LOAD/INSTALL", + "url": "load_and_install" } ] }, diff --git a/docs/sql/statements/install.md b/docs/sql/statements/install.md deleted file mode 100644 index ed6414664a7..00000000000 --- a/docs/sql/statements/install.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: docu -title: INSTALL Statement -railroad: statements/install.js ---- - -The `INSTALL` statement downloads an extension so it can be [loaded]({% link docs/sql/statements/load.md %}) into a duckdb session. - -## Examples - -Install the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: - -```sql -INSTALL httpfs; -``` - -Install the h3 [community extension]({% link docs/extensions/community_extensions.md %}): - -```sql -INSTALL h3 from community; -``` - -## Syntax - -
diff --git a/docs/sql/statements/load.md b/docs/sql/statements/load.md deleted file mode 100644 index 6d30f307a4c..00000000000 --- a/docs/sql/statements/load.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: docu -title: LOAD Statement -railroad: statements/load.js ---- - -The `LOAD` statement loads an installed duckdb extension into the current session. - -## Examples - -Load the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: - -```sql -LOAD httpfs; -``` - -Load the [`spatial`]({% link docs/extensions/spatial.md %}) extension: - -```sql -LOAD spatial; -``` - -## Syntax - -
diff --git a/docs/sql/statements/load_and_install.md b/docs/sql/statements/load_and_install.md new file mode 100644 index 00000000000..224371e6bfd --- /dev/null +++ b/docs/sql/statements/load_and_install.md @@ -0,0 +1,49 @@ +--- +layout: docu +title: LOAD/INSTALL Statements +railroad: statements/load_and_install.js +--- + +# INSTALL + +The `INSTALL` statement downloads an extension so it can be loaded into a duckdb session. + +## Examples + +Install the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: + +```sql +INSTALL httpfs; +``` + +Install the h3 [community extension]({% link docs/extensions/community_extensions.md %}): + +```sql +INSTALL h3 from community; +``` + +## Syntax + +
+ +# LOAD + +The `LOAD` statement loads an installed duckdb extension into the current session. + +## Examples + +Load the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: + +```sql +LOAD httpfs; +``` + +Load the [`spatial`]({% link docs/extensions/spatial.md %}) extension: + +```sql +LOAD spatial; +``` + +## Syntax + +
diff --git a/js/statements/load.js b/js/statements/load.js deleted file mode 100644 index 02d7a758ea1..00000000000 --- a/js/statements/load.js +++ /dev/null @@ -1,21 +0,0 @@ -function GenerateLoad(options = {}) { - return Diagram([ - AutomaticStack([ - Keyword("LOAD"), - Expression("extension-name") - ]) - ]) -} - -function Initialize(options = {}) { - document.getElementById("rrdiagram1").classList.add("limit-width"); - document.getElementById("rrdiagram1").innerHTML = GenerateLoad(options).toString(); -} - -function Refresh(node_name, set_node) { - options[node_name] = set_node; - Initialize(options); -} - -options = {} -Initialize() diff --git a/js/statements/install.js b/js/statements/load_and_install.js similarity index 71% rename from js/statements/install.js rename to js/statements/load_and_install.js index 36a2634596f..642a3bbdef9 100644 --- a/js/statements/install.js +++ b/js/statements/load_and_install.js @@ -1,3 +1,12 @@ +function GenerateLoad(options = {}) { + return Diagram([ + AutomaticStack([ + Keyword("LOAD"), + Expression("extension-name") + ]) + ]) +} + function GenerateInstall(options = {}) { return Diagram([ AutomaticStack([ @@ -27,7 +36,10 @@ function GenerateInstall(options = {}) { function Initialize(options = {}) { document.getElementById("rrdiagram1").classList.add("limit-width"); - document.getElementById("rrdiagram1").innerHTML = GenerateInstall(options).toString(); + document.getElementById("rrdiagram1").innerHTML = GenerateLoad(options).toString(); + + document.getElementById("rrdiagram2").classList.add("limit-width"); + document.getElementById("rrdiagram2").innerHTML = GenerateInstall(options).toString(); } function Refresh(node_name, set_node) { From 4d99042040661125190bccb7e385c6604c165bf5 Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Wed, 11 Sep 2024 16:21:06 +0200 Subject: [PATCH 3/7] Add spaces --- _data/menu_docs_dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/menu_docs_dev.json b/_data/menu_docs_dev.json index f277e875603..e110088cba2 100644 --- a/_data/menu_docs_dev.json +++ b/_data/menu_docs_dev.json @@ -522,7 +522,7 @@ "url": "vacuum" }, { - "page": "LOAD/INSTALL", + "page": "LOAD / INSTALL", "url": "load_and_install" } ] From f466b265c9422dd176ab56ddce13ef6fb4a5c1c0 Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Wed, 11 Sep 2024 16:22:01 +0200 Subject: [PATCH 4/7] Formatting adjustments --- docs/sql/statements/load_and_install.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/sql/statements/load_and_install.md b/docs/sql/statements/load_and_install.md index 224371e6bfd..083ddb0f49e 100644 --- a/docs/sql/statements/load_and_install.md +++ b/docs/sql/statements/load_and_install.md @@ -4,11 +4,11 @@ title: LOAD/INSTALL Statements railroad: statements/load_and_install.js --- -# INSTALL +## `INSTALL` -The `INSTALL` statement downloads an extension so it can be loaded into a duckdb session. +The `INSTALL` statement downloads an extension so it can be loaded into a DuckDB session. -## Examples +### Examples Install the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: @@ -22,15 +22,15 @@ Install the h3 [community extension]({% link docs/extensions/community_extension INSTALL h3 from community; ``` -## Syntax +### Syntax
-# LOAD +## `LOAD` -The `LOAD` statement loads an installed duckdb extension into the current session. +The `LOAD` statement loads an installed DuckDB extension into the current session. -## Examples +### Examples Load the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: @@ -44,6 +44,6 @@ Load the [`spatial`]({% link docs/extensions/spatial.md %}) extension: LOAD spatial; ``` -## Syntax +### Syntax
From b3da6ae62085eab8438e7cefa13dc7a0399e16a3 Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Wed, 11 Sep 2024 16:22:44 +0200 Subject: [PATCH 5/7] Add space --- docs/sql/statements/load_and_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql/statements/load_and_install.md b/docs/sql/statements/load_and_install.md index 083ddb0f49e..e64391ffd05 100644 --- a/docs/sql/statements/load_and_install.md +++ b/docs/sql/statements/load_and_install.md @@ -1,6 +1,6 @@ --- layout: docu -title: LOAD/INSTALL Statements +title: LOAD / INSTALL Statements railroad: statements/load_and_install.js --- From 4b6ff3804ba0d50e0bad0a7b440a04b367e4f92c Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Wed, 11 Sep 2024 16:23:01 +0200 Subject: [PATCH 6/7] caps --- docs/sql/statements/load_and_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql/statements/load_and_install.md b/docs/sql/statements/load_and_install.md index e64391ffd05..5015fea7308 100644 --- a/docs/sql/statements/load_and_install.md +++ b/docs/sql/statements/load_and_install.md @@ -19,7 +19,7 @@ INSTALL httpfs; Install the h3 [community extension]({% link docs/extensions/community_extensions.md %}): ```sql -INSTALL h3 from community; +INSTALL h3 FROM community; ``` ### Syntax From c7946509ca1041ad0c80dbf646f9dc85731bc747 Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Wed, 11 Sep 2024 16:23:11 +0200 Subject: [PATCH 7/7] Formatting --- docs/sql/statements/load_and_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql/statements/load_and_install.md b/docs/sql/statements/load_and_install.md index 5015fea7308..b712b92c56d 100644 --- a/docs/sql/statements/load_and_install.md +++ b/docs/sql/statements/load_and_install.md @@ -16,7 +16,7 @@ Install the [`httpfs`]({% link docs/extensions/httpfs/overview.md %}) extension: INSTALL httpfs; ``` -Install the h3 [community extension]({% link docs/extensions/community_extensions.md %}): +Install the `h3` [Community Extension]({% link docs/extensions/community_extensions.md %}): ```sql INSTALL h3 FROM community;