duckweb_render_function

setting · LOAD duckweb

duckweb_render_function — VARCHAR, global

The setting that names which function the transport calls to render a request.

SET GLOBAL duckweb_render_function = 'notesapp_render';

It defaults to the SQL macro render, which is why most apps never mention it.

Why it exists

A SQL macro cannot write: INSERT inside CREATE MACRO ... AS TABLE is a parser error. An app with a route that has to store something therefore supplies a real table function from its own extension and points this setting at it. The notesapp example in the repository exists to prove that escape hatch carries weight.

Why it is a setting

Unlike the HTTPS options, which are arguments to duckweb_serve, this is also read in the browser tiers — where there is no server to pass an argument to. A server that wants its own still can: duckweb_serve’s render option overrides this for that server alone, which is how one process serves two apps.

Whatever it names must take (method, route, headers, body) and return a single VARCHAR column whose rows, concatenated, are a complete HTTP response.