You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/databases.html
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,11 @@
31
31
**Ifqueryresultsaresaved,howdoIupdatethem?**InObservableDesktop,youcanre-runaSQLcellbyclickingthe**Play**button,byhitting<spanstyle="font-family: var(--sans-serif);">**shift-return**</span>, or by clicking on the query age in the cell toolbar. In Observable Notebook Kit, delete the corresponding file from the `.observable/cache` directory; you can also use continuous deployment, such as GitHub Actions, to refresh data automatically.
thenanotebook`docs/example.html`canaccessanydatabaseconfiguredin<code>docs/<wbr>.observable/<wbr>databases.json</code>. In the future, Observable Desktop will provide a built-in UI for configuring databases.
**HowdoIquerymydatabase?**Insertanewcell,saybyclickingthe<b>+</b> button between cells. Convert the new cell to SQL by hitting down or <spanstyle="font-family: var(--sans-serif);">⌘4</span>. By default, SQL cells query the default `duckdb` in-memory database. To query a different database, edit the **database** in the cell toolbar, then click ↩︎ or hit <spanstyle="font-family: var(--sans-serif);">return</span>. Then refocus the SQL cell, edit your query, and hit <spanstyle="font-family: var(--sans-serif);">shift-return</span> to run it.
@@ -151,7 +151,7 @@
151
151
**WhataboutcustomdatabaseclientsandDuckDB-Wasm?**IfyouspecifyaSQL's database using `var:` (such as `var:db`), you can then provide a custom database client of the given name (such as `db`) that runs in the browser. This feature is most often used with `DuckDBClient` (DuckDB-Wasm), but you can provide any object that exposes a `sql` tagged template literal.
Whenbuildingnotebooks,weusestaticgenerationforMarkdownandHTMLcells: staticcontentisstaticallyrendered.Thisimprovestheuserexperiencebyacceleratingthefirstcontentfulpaint,andbyreducingreflowduringpageload---yourpageappearsinstantly.It's good for SEO, too, because static content is now readable by search engines without JavaScript.
204
+
Whenbuildingnotebooks,weusestaticgenerationforMarkdownandHTMLcells: staticcontentisstaticallyrendered.We"bake"theresultsofstatic[databasequeries](./databases),too.Staticgenerationimprovestheuserexperiencebyacceleratingthefirstcontentfulpaint,andbyreducingreflowduringpageload---yourpageappearsinstantly.It's good for SEO, too, because static content is now readable by search engines without JavaScript.
205
205
</script>
206
206
<scriptid="19" type="text/markdown">
207
207
<aside>You can also use the new Vite plugin directly if you want to integrate notebooks into your existing Vite-based application.</aside>
NotebookKit's CLI supports three commands: `preview` for a live preview of notebooks, `build` for building a static site, and `download` for downloading Observable Notebooks as HTML.
248
+
NotebookKit's CLI supports four commands: `preview` for a live preview of notebooks, `build` for building a static site, `download` for downloading Observable Notebooks as HTML, and `query` for saving the results of database queries.
Transpilesthespecifiedcellsourcecode,giventhecell's `mode`. The transpiled source is returned as a `body` function suitable for use with [`variable.define`](https://github.com/observablehq/runtime/blob/main/README.md#variabledefinename-inputs-definition) from the Observable Runtime, along with any named `inputs` (unbound references) and `outputs` (top-level declarations).
Instantiates a new notebook runtime, given the specified built-ins, which defaults to (the standard) `library`. The returned instance exposes a `runtime`, `main`, and `define` methods which are equivalent to those below, but scoped to this specific instance. This constructor allows multiple notebooks to be instantiated concurrently.
The built-ins provided to the runtime; the notebook standard library. This object includes the definitions for various built-ins, such as `now`, `width`, `Generators`, and `Mutable`.
0 commit comments