Name

table_info — List column information for a table

Common Usage

PRAGMA [database.]table_info( table_name );

Description

The table_info pragma is used to query information about a specific table. The result set will contain one row for each column in the table.

Column nameColumn typeMeaning
cid IntegerColumn index
name TextColumn name
type TextColumn type, as given
notnull IntegerHas a NOT NULL constraint
dflt_value TextDEFAULT value
pk IntegerIs part of the PRIMARY KEY

The default value (dflt_value) will be given as a text representation of the literal value representation. For example, a default text value includes the single quotes.

See Also

index_list

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.