This feature works better with dynamic hosting. If you are using `fastn` in
[static site mode](/static/), then how the page looked when `fastn build` was
called will be shown to everyone. But if you are using [dynamic
mode](/server/) then this page would be regenerated on every page load.
`$processor$`
A processor is used when declaring a variable. The processor is in control of
the variable if `$processor$` key is used.
-- import: fastn/processors as pr
-- person list people:
$processor$: pr.package-query
db: db.sqlite
SELECT * FROM user;
As you see `$processor$` key was used when defining the variable called
`people`. Once `$processor$` is used, the rest of the section is in determined
bu the specific processor used. Like in this case the processor
`pr.package-query` expects a key named `db`, which refers to the database file,
and the body of the section is the SQL query to execute against the database.
A processor must be used on a variable or a list with matching type as the
output of the processor. In this case we are using `SELECT * FROM user;` so the
columns of the `user` table must match the fields of the record `person`. Extra
data will be ignored, but all required data must be passed for processor to
work correctly.
The details of what the processor returns is documented as part of each
processors documentation.
Planned: Custom Processors
`fastn` is planning to use [wasmtime](https://wasmtime.dev) to let anyone write
their own custom processors, which will allow much more functionalities.