Help › Work in notebooks
Give a notebook parameters
Add typed parameters to a notebook (text, numbers, dates, date ranges, true or false, lists filled by a query), use them in query cells, and run the notebook with other values, as papermill does.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
A notebook can take parameters: a region, a date range, a minimum total. You set them once at the top, and every query cell that names them uses their values. Run the notebook again with other values and the whole report follows.
Querlyn's parameters are those of papermill, the tool that runs
Jupyter notebooks with other values: the parameters are a code cell tagged
parameters that assigns each one in Python (region = "EU"). Querlyn
shows that cell as a form, and writes a value you change back into its
line only, so papermill and Jupyter still run the notebook, and a
notebook made for papermill opens with its parameters in Querlyn.
Add and change parameters
(, and Add Parameter on the parameters cell) adds one; the first one adds the parameters cell at the top of the notebook. A parameter has:
A name: letters, digits and
_, starting with a letter or_.A type, which decides its input:
Type Input What query cells bind Text a text field the text Number a text field that takes a number the number Date a date, written 2026-10-09the date as text, which the server reads as a date where one is wanted Date range two dates two parameters: name_startandname_endTrue or false a check box true or false List a choice from a list, or any text the choice For a list, the query its choices come from, and the connection it runs on (the notebook's, unless you choose another). The choices are the first column of its rows, up to 1,000. They are read only when you click the refresh button beside the list, and only from a query that only reads: a query that could change anything is refused, whoever wrote it.
The pencil beside a parameter changes its name, type or list, or Removes it. To change a value, change it in the form: a value that is not one of the parameter's type (a word for a number, a date that is not a date) is not written to the cell, which keeps the last good one and says so.
Edit as Text on the parameters cell shows the cell's Python, to change it by hand; running the cell shows the form again. Lines that are not simple values (an expression, a function) are kept as they are; a parameter assigned one shows that Querlyn cannot read its value.
Use parameters in query cells
A query cell names a parameter with its connection's marker for named
parameters: :region on PostgreSQL, MySQL, SQL Server, Oracle, Snowflake
and SQLite, $region on DuckDB and the scratch, {region:String} on
ClickHouse. A date range named period is :period_start and
:period_end:
SELECT status, count(*)
FROM orders
WHERE region = :region
AND placed BETWEEN :period_start AND :period_end
GROUP BY status
The values are bound, as query parameters are: the statement goes to the server as you wrote it, with the values beside it, or, on engines that do not bind, written in by the server's own quoting as one value each. A value can never change a statement, whatever it holds. A marker no parameter names stops the run before anything runs and says which; a cell without markers runs as it is.
Use parameters in Python cells
Python cells get the parameters as papermill gives them: before a run's first Python cell, each parameter is set as a Python variable of its name, typed, with the run's value. See Use the notebook's parameters in Python.
Run with other values
(, and on the parameters cell) asks for a value of each parameter, filled with the form's, and runs every cell once with them. The parameters cell keeps its own values. Production still asks before anything runs, as for any run.
The values each cell ran with are saved with its results in the file, so a saved report says what it is a report of.
Notebooks run by papermill
papermill runs a notebook with other values by adding a cell tagged
injected-parameters after the parameters cell. Querlyn shows that cell
as it is, read-only, and the parameters form says which values papermill
ran the notebook with; Querlyn runs it with the form's values.
Help for Querlyn 0.1.0. All help topics