Page 1 of 1

About Sqlite metadata of table

Posted: Mon 11 Aug 2014 10:41
by wangxiya
dear UNIDAC team:
Since sqlite has function to get metadata of table:
int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
const char *zDbName, /* Database name or NULL */
const char *zTableName, /* Table name */
const char *zColumnName, /* Column name */
char const **pzDataType, /* OUTPUT: Declared data type */
char const **pzCollSeq, /* OUTPUT: Collation sequence name */
int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
int *pPrimaryKey, /* OUTPUT: True if column part of PK */
int *pAutoinc /* OUTPUT: True if column is auto-increment */
);

why unidac can't get the information correctly?

Re: About Sqlite metadata of table

Posted: Mon 11 Aug 2014 15:27
by PavloP
Please specify exactly what information UniDAC retrieves incorrect.

Re: About Sqlite metadata of table

Posted: Tue 12 Aug 2014 03:34
by wangxiya
Sorry I'm not descript the detail:
I use TUniMetaData to get metadata of sqlite table;
First, I use MetaDataKind := 'Columns' to get the column information.
Then, I use MetaDataKind := 'Constraints' to get the primary key information.
last, I use MetaDataKind := 'IndexColumns' to get the primary key detail information.

but, in sqlite, I can't get the primary key information in second step!

Maybe I got the wrong method?

Re: About Sqlite metadata of table

Posted: Thu 14 Aug 2014 09:14
by PavloP
We detected the error when getting metadata when MetaDataKind := 'Constraints'. It will be fixed in the next build.