Repository navigation
SQL notebook: import/export, variables, autosave, a usable cell UI - #258
Merged
Merged
Conversation
…an work in
- Open .sqlnb, Jupyter .ipynb (%%sql magics), Markdown (```sql fences become
cells) and .sql scripts (-- %% markers or blank-line groups); Import adds
another file's cells to the notebook you are in.
- Export: HTML report (results included, light and dark, printable),
Markdown with result tables, Jupyter (%%sql), SQL script (-- %% cells).
- {{name}} variables, filled from a bar under the toolbar; a placeholder
without a value says so instead of reaching the database.
- Autosave once the notebook has a file (toggle in the Save menu), Save as
(Mod+Shift+S), and a Recent list in Open.
- Cells: Jupyter-style run counter, rows / ms / when it ran, the variables
a query uses, editor sized to the query (drag to override, double-click to
fit), Shift+Enter runs and moves on, duplicate, clear outputs, Run all
stops at the first failing cell (Mod+Shift+Enter), copy results as TSV.
- Markdown cells: rendered through the sanitising renderer (a notebook can
be a downloaded file), list continuation and Tab indent while typing.
Converters and variables are pure functions in notebook.js with tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the SQL notebook properly usable.
Files, on your computer
.sqlnb, Jupyter.ipynb(%%sqland%sqlmagics), Markdown (``````sql```` fences become SQL cells and the prose becomes text cells), and.sqlscripts (split on `-- %%` markers, or on blank-line groups).%%sqlcells), or a SQL script (-- %%cells).Variables: write
{{name}}in a query and fill it from the variables bar. Placeholders without a value show as dashed+ namechips, and a cell that runs with one missing explains why instead of sending broken SQL.Cells
renderSafeMarkdowninmarkdown-safe.js: raw HTML shows as text, only web and mail links are allowed, and images become links. Notebooks can be downloaded files, andmarked.parsewas rendering them unsanitised. Text cells also get list continuation and Tab indent while typing.Tests:
notebook.test.jscovers variables, every import format, every export, and round-trips (10 tests).markdown-safe.test.jscovers the sanitiser.Checks:
npm test1795 passed (exit 0), design lint clean,npm run check0 errors,npm run buildpassed.🤖 Generated with Claude Code