Name
sqlite3_table_column_metadata() — Lookup extended column metadata
Definition
int sqlite3_table_column_metadata( sqlite3* db,
const char* db_name, const char* tbl_name, const char* col_name,
const char** datatype, const char** collation,
int* not_null, int* primary_key, int* autoincrement );-
db A database connection.
-
db_name A logical database name, encoded in UTF-8. The name may be
main,temp, or a name given toATTACH DATABASE.-
tbl_name A table name.
-
col_name A column name.
-
datatype A reference to a string. The declared datatype will be passed back. This is the datatype that appears in the
CREATE TABLEstatement.-
collation A reference to a string. The declared collation will be passed back.
-
not_null A reference to an integer. If a nonzero value is passed back, the column has a
NOT NULLconstraint.-
primary_key A reference to an integer. If a nonzero value is passed back, the column is part of the table’s primary key.
-
autoincrement A reference to an integer. If a nonzero value is passed back, the column is set to
AUTOINCREMENT. This implies the column is aROWIDalias, and has been designated as anINTEGER PRIMARY KEY.- Returns
An SQLite result code.
Description
This function is used to retrieve information about a specific
column. Given a database connection, a logical database name, a
table name, and the name of the column, this function will pass
back the original datatype (as given in the CREATE TABLE statement) and the default collation name. A set of flags will also be returned, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access