About Sqlite metadata of table

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wangxiya
Posts: 4
Joined: Tue 10 Jul 2012 14:35

About Sqlite metadata of table

Post by wangxiya » Mon 11 Aug 2014 10:41

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?

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: About Sqlite metadata of table

Post by PavloP » Mon 11 Aug 2014 15:27

Please specify exactly what information UniDAC retrieves incorrect.

wangxiya
Posts: 4
Joined: Tue 10 Jul 2012 14:35

Re: About Sqlite metadata of table

Post by wangxiya » Tue 12 Aug 2014 03:34

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?

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: About Sqlite metadata of table

Post by PavloP » Thu 14 Aug 2014 09:14

We detected the error when getting metadata when MetaDataKind := 'Constraints'. It will be fixed in the next build.

Post Reply