Hi Ed,

Sorry the answer took a while. I'm on holiday this week
and the computer use is cut down a little. :))
I didn't find any official documentation, but I did find these threads
http://thread.gmane.org/gmane.comp.db.sqlite.general/8287
http://thread.gmane.org/gmane.comp.db.sqlite.general/5115

and also the checking in the SQLite Trac:
http://www.sqlite.org/cvstrac/chngview?cn=1081
this is the search that found the checkin
http://www.sqlite.org/cvstrac/search?s=table_info&c=1

adi

Am Mon, 22 Aug 2005 20:02:51 +0200 schrieb Ed Leafe <[EMAIL PROTECTED]>:

On Aug 22, 2005, at 1:53 PM, Adi J. Sieker wrote:

One thing i did notice though.
The result of PRAGMA table_info contains a 1 in the 6th column if the key is a primary key,
as far as I understood.

Cool! Is that documented somewhere? I'm just going by the docs on the sqlite.org site, where they only say:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PRAGMA table_info(table-name);

For each column in the named table, invoke the callback function once with information about that column, including the column name, data type, whether or not the column can be NULL, and the default value for the column.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So they only describe four pieces of info, yet you are correct that there are actually 6 columns; here's what I get for the 'zipcodes' table:

sqlite> pragma table_info("zipcodes");
0|iid|integer|99||1
1|ccity|text(64)|99||0
2|cstateprov|text(2)|99||0
3|czip|text(5)|99||0
4|ccounty|text(20)|99||0
5|careacode|text(3)|99||0
6|clatitude|text(10)|99||0
7|clongitude|text(10)|99||0
8|ctimezonediff|text(3)|99||0
If you can find documentation on this, I can change the code to use this instead of my current technique: parsing the CREATE SQL statement returned by querying the sqlite_master table for the words 'primary key'.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to