DuckDB Table Info Query

This snippet demonstrates how to use the PRAGMA table_info function in DuckDB to get detailedinformation about a specific table’s structure.

Try out this query here

-- Returns detailed information about a table's structure
-- Use this to get the column names, types, and other details
PRAGMA table_info('table_name');

Example Output

cidnametypenotnulldflt_valuepk
0idVARCHARfalsenullfalse
1conversationsSTRUCT(“from” VARCHAR, “value” VARCHAR)[]falsenullfalse
2categoryVARCHARfalsenullfalse
3subcategoryVARCHARfalsenullfalse
4taskVARCHARfalsenullfalse

You can read more about this here.

Example Usage