duckweb_query

scalar · LOAD duckweb

duckweb_query(VARCHAR, VARCHAR) -> VARCHAR

Reads one key from the request target’s query string.

duckweb_query(route, 'note')

route is the second argument render receives: the request target, query string and all. duckweb_query finds the ?, ignores any # fragment, and looks the key up in what is left.

Decoding is the urlencoded form: %XX escapes and + for space, so ?note=hi+%3Cb%3E gives hi <b>. A key that is not there reads as the empty string. The first occurrence wins when a key repeats.

Invalid escapes are left as written rather than rejected — a malformed URL should render a strange-looking page, not fail the request.

This value is user input. Escape it on the way out with duckweb_escape, or let duckweb_tpl do it.