duckweb_slot_fill

scalar · LOAD duckweb

duckweb_slot_fill(VARCHAR, VARCHAR) -> VARCHAR

Delivers the content for a slot, later in the same response.

SELECT duckweb_chunk(duckweb_slot_fill('chart', chart_svg(s.name)))
FROM duckweb_match(route, '/species/:name') m, sightings s
WHERE method = 'GET' AND s.name = m.name

Emits the content in a hidden div followed by a small inline script that moves it into the matching duckweb_slot and removes itself.

A hidden div rather than a <template>: a </template> inside the content would end the element early, whereas a div nests the way any other balanced markup does. The script is self-contained, so a plain browser parsing the response runs it with no client library present.

The id must match the slot’s, and is filtered the same way.