Getting started
funktionalCreate a notebook, write and run your first SQL and Markdown cells, save it as a .sqllynb file, and open notebooks other people send you.
This walkthrough builds a small notebook from nothing: a note, a base query, and a second query that reads the first one's result by name. It takes about five minutes and works on any database SQLly connects to.
Create a notebook
Pick whichever is closest to hand:
- File ▸ New Notebook, oder Neues Notebook in the command palette.
- Turn the query you're already writing into one: right-click its tab and choose Open as Notebook (the whole script becomes one cell) or Open as Notebook, One Cell per Statement (one cell per statement, split the same way Run splits them, on
;undGO). Query ▸ Open Query as Notebook and the palette do the same. The new notebook keeps the tab's connection. - File ▸ Open Notebook… opens a
.sqllynbfile, an older.sqlnb.jsonnotebook or a Jupyter.ipynb.


A new notebook opens in its own tab (named "Notebook 1" until you give it a title) with one empty SQL cell. It uses the connection shown in the top bar, Connection: …; pick a different one there, or give single cells their own connection later.
Write your first cells
- Add a note. In the row of buttons under the last cell, click Markdown cell and type a heading such as
# Orders by country. Click Fertig to see it rendered; double-click it to edit again. Headings show up in the Outline on the left. - Write the base query in the SQL cell. Click into it to edit; the editor has the same IntelliSense as a query tab and grows with its content.
SELECT o.OrderID, o.ShipCountry, o.Freight FROM dbo.Orders AS o WHERE o.OrderDate >= '1997-01-01' - Name it. With the cell selected, type
ordersim Name field of the inspector on the right. A name is what other cells use to read this one. - Führe es aus mit ⌘Return (Strg+Enter) or the play button in the top bar. The result grid opens under the cell, and its header changes from Not run zu Up to date.
- Build on it. Klicken SQL cell to add another, and read the first cell's result by putting its name in double curly braces:
Run it. SQLly folds theSELECT ShipCountry, COUNT(*) AS Orders, SUM(Freight) AS Freight FROM {{orders}} GROUP BY ShipCountry ORDER BY Freight DESCordersquery into this one as a common table expression, so the database runs one query and nothing is copied. See Named cells and references for how that works on each engine. - Change the base query (say, the date) and look at the second cell: it now says Out of date, because the result it shows no longer matches the SQL it reads. Press Alles ausführen (⌘⇧Return), or choose Run ▸ Run Stale Cells to run only what is out of date.
The add-cell row (and the + between cells) offers every kind of cell, from charts and KPI tiles to data checks and AI cells; Cells and cell types lists them. ⇧Return runs a cell and moves to the next one, and Esc switches to command mode, where single keys add, delete and convert cells; see the keyboard reference.


Save it
Drücke Speichern in the top bar, File ▸ Save Notebook oder ⌘S and choose a name: notebooks save as .sqllynb files (More ▸ Save As picks a new name later). The file holds the cells and their settings, not the results, so it stays small and diffs cleanly; see File format and Git. A notebook opened from a Jupyter .ipynb keeps saving as .ipynb. One opened from an older .sqlnb.json file is saved as a new .sqllynb file rather than overwriting the old one.
- Unsaved notebooks are not lost. Until you save, SQLly keeps a recovery copy, written as you edit, and reopens the notebook with your workspace after a restart or a crash. The top bar says Recovered when that happens. Closing the tab or saving it to a file removes the copy.
- Autosave to a file is opt-in. Einschalten More ▸ Autosave to File to have a saved notebook write itself to its file as you edit.
- Changes from elsewhere are noticed. If the file changes on disk while it's open (a
git pull, a sync folder), the top bar shows Changed on disk mit Neu laden und Keep mine, and nothing is overwritten until you choose: Save refuses with "… changed on disk. Choose Reload or Keep mine before saving." In the browser build the same guard covers a notebook changed in another tab. - A copy gets its own identity. If you copy a notebook file by hand, or keep working in the original after Speichern unter, the two files start out with the same notebook id. The file this computer already knew keeps its trust, run history and local data; the other one gets a new id the first time you save it, and SQLly tells you once: "This file is a copy of another notebook, so it now has its own identity: its trust, run history and local data are kept apart from the original's."


Open a notebook someone sent you
Opening a notebook never runs anything. A notebook you didn't create on this computer, or one whose SQL or connections were changed outside SQLly since you trusted it, opens behind a banner, and none of its cells run until you press Trust notebook and choose which connections it may use. Read its SQL first: everything is visible before you decide.


If the notebook names connections this computer doesn't have, SQLly asks you to map each one to a connection of yours. Both steps are covered in Connections and safety.
Before a notebook file opens, SQLly checks it for anything unsafe. A file that fails the check isn't opened at all ("This notebook was not opened because it may be unsafe: …"). Things worth knowing that don't block it, such as an image loaded from the web or a notebook that re-runs itself when its parameters change, show in a banner under the top bar that you can dismiss, and in the activity panel. See Security model.


Back to a plain script
Export ▸ Convert to SQL Script in the notebook's top bar (also Query ▸ Convert Notebook to SQL Script) opens the notebook as one SQL script in a new query tab: references are expanded into the SQL where they can be, and Markdown cells become -- comments. Other cell kinds, such as charts, are left out.
Where next
- The notebook layout: what every panel is for.
- Running notebooks: run modes, state badges and row limits.
- Charts, tables, pivots and KPIs: turn a result into a picture.
- Embedded outputs and report-style notebooks: hide the SQL and let the results read like a report.