Skip to main content

aggregate_update_callback

Macro aggregate_update_callback 

Source
macro_rules! aggregate_update_callback {
    ($name:ident, |$info:ident, $input:ident, $states:ident| $body:block) => { ... };
}
Expand description

Generates a panic-safe unsafe extern "C" aggregate update callback.

Emits unsafe extern "C" fn $name(info: duckdb_function_info, input: duckdb_data_chunk, states: *mut duckdb_aggregate_state). A panic is reported through duckdb_aggregate_function_set_error.

Aggregate callbacks run on DuckDB’s worker threads, so an unguarded panic here aborts the process from a thread the user never sees.

§Example

quack_rs::aggregate_update_callback!(my_update, |info, input, states| {
    let _ = (input, states);
});