Skip to main content

Module table_description

Module table_description 

Source
Expand description

Table description metadata.

Allows querying a table’s structure — column names, whether a column has a DEFAULT, and (with duckdb-1-5) the column count and types — at runtime from within an extension. Useful for replacement scans, table functions, and copy functions that need to inspect existing tables before deciding what to do.

§Feature flags

Creating and naming columns needs no feature flag: duckdb_table_description_* has been in the frozen stable prefix of the extension API (slots 292–297) since v1.2.0. Two accessors are DuckDB 1.5.0 additions living in the unstable region and are gated on duckdb-1-5: column_count and column_type. They are not linked here because the links would not resolve when the feature is off, which is exactly when a reader most wants to know they exist.

§Example

use quack_rs::table_description::TableDescription;

// From within a function callback with a valid connection:
// let desc = unsafe { TableDescription::create(con, "main", "my_table")? };
// let first = desc.column_name(0);

Structs§

TableDescription
RAII wrapper for a duckdb_table_description.