-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3609 from Tishj/install_and_load_statement_docs
[Statements] Add `INSTALL` and `LOAD` statement docs
- Loading branch information
Showing
3 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<div id="rrdiagram2"></div> | ||
|
||
## `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 | ||
|
||
<div id="rrdiagram1"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function GenerateLoad(options = {}) { | ||
return Diagram([ | ||
AutomaticStack([ | ||
Keyword("LOAD"), | ||
Expression("extension-name") | ||
]) | ||
]) | ||
} | ||
|
||
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 = GenerateLoad(options).toString(); | ||
|
||
document.getElementById("rrdiagram2").classList.add("limit-width"); | ||
document.getElementById("rrdiagram2").innerHTML = GenerateInstall(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() |