tableInfo

Retrieves detailed information about the columns of a specific table.

This pragma returns one row for each column in the specified table. The returned cursor contains the following columns:

  • cid: The column ID, a unique non-negative integer for each column.

  • name: The name of the column.

  • type: The declared data type of the column (e.g., "INTEGER", "TEXT").

  • notnull: A boolean flag that is 1 if the column has a NOT NULL constraint and 0 otherwise.

  • dflt_value: The default value for the column, or NULL if there is none.

  • pk: An integer indicating if the column is part of the primary key. It is 1 for the first column of the primary key, 2 for the second, and so on. It is 0 if the column is not part of the primary key.

This is essential for introspecting the schema of a table at runtime.

Return

A KQLiteCursor containing the schema information for the table's columns.

Author

MOHAMMAD AZIM ANSARI

Parameters

table

The table for which to retrieve column information.

See also