Is it possible with this information to reliably tell if the first column of the table is an auto increment column?
The available information is as follows :
database handle ($dbh)
database name
table name
Is it possible with this information to reliably tell if the first column of the table is an auto increment column?
The available information is as follows :
database handle ($dbh)
database name
table name
You can query table
COLUMNS
in the mysql information schema, using columnEXTRA
.You would assume that an autoincremented column is of integer datatype, is not nullable and has no default value.
It is also probably possible to use the DBI catalog functions to achieve the same operation in a database-independent way.