Help › Work in notebooks
See what changed since a cell's last run
A notebook's query cells keep their previous result and say how many rows were added, changed and removed since the run before, in the window and in scheduled runs.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
Each query cell of a notebook keeps the result of the run before its last. When the cell runs again it says what changed above its result: 3 rows added, 1 changed since the run of 10 Oct 09:00, or No changes. Only counts are kept; to see the rows themselves, open the comparison.
Nothing is read from a server for this: Querlyn compares the rows the two runs loaded, with the same rules as comparing two results. Decimals compare exactly, floating-point numbers by their value, NULL equals only NULL.
What is compared
- A cell's last result set of each run (a cell with several statements is compared on its last result).
- Every row, when both runs loaded every row. When one of the two results is not whole (a result with more rows to read, or one that a file saved only the first rows of), only the first rows both hold are compared, and the cell says how many when you rest the pointer on its line.
- A column only one of the two results has is counted as a column that differs and named in the line's tooltip.
- A column whose values were masked when the notebook was saved is left out: the file does not hold its values. The tooltip says how many columns were left out.
Explain, Python cells and text cells are not compared.
Choose how rows are matched
To tell a changed row from a new one, Querlyn has to know which row of the earlier result is the same row. It uses, in this order:
- the columns you chose for the cell with ;
- the primary key, or a unique key without NULLs, of the one table the result's columns come from, when the result holds its columns;
- nothing: the cell says Choose how to match rows to see what changed and waits. Querlyn does not guess.
Match Rows… (beside the cell's line, in the cell's right-click menu and at ) lists the columns both results have, and marks the ones whose values look like a key (never empty, never repeated). Tick the columns that identify a row, or Match whole rows: then a row with any other value counts as one removed and one added, and repeated rows are counted by how many copies each result has. With nothing ticked the cell goes back to the key Querlyn finds.
The choice is kept with the cell in the notebook's file, so the next run, another computer and a scheduled run match the same way. Rows whose key repeats or holds a NULL cannot be matched; they are counted as not matched.
Open the comparison
(Open Comparison beside the line) opens the two results in a comparison tab, matched as the cell matches them: rows added, removed and changed side by side, with the values that differ marked, and Copy and Export of the differences.
The earlier result is held in memory within the result memory budget. When a new result needs the room, the earlier one is let go first; the cell keeps its counts and Open Comparison says to run the cell again.
What the file keeps
- The counts and how the rows were matched, always. A notebook opened again still says what changed between its last two runs.
- The last result, within the notebook's bound, as always. After opening a notebook, the next run is compared with that saved result.
- The previous result only when you ask: (also in the notebook's settings, ). It is written in Querlyn's own form only, within the same bound, and counted against the notebook's limit after the results themselves: when the limit is reached, the previous results are the first to be cut. Masked columns are never written. With it on, Open Comparison works right after opening the notebook.
removes the counts and the previous results with the results; how rows are matched stays.
In scheduled and command-line runs
querlyn notebook run compares each cell's result with the result the
run before wrote to the same output file, when there is one, and else with
the result saved in the notebook itself. It says what changed under each
cell:
✓ cell 2: 9 rows
since the last run: 1 row added, 2 changed, 1 removed since 10 Oct 09:00
The lines are in a scheduled run's record in Scheduled Runs, in the message of a delivery, and in the report under each result. A cell without a key and without a choice is not compared and says so; choose how its rows are matched once in Querlyn and save the notebook.
Help for Querlyn 0.1.0. All help topics