I have also been looking to retrieve schema data as well.

I have managed to get the: "PRAGMA table_info(<table>)" to return a result
set.

But when attempting the same trick for indexes with: "PRAGMA
index_info(index-name)"
I am getting an empty result set.  What is the structure of the index-name?
Within the PRAGA statement, in what manner is the named index associated
with the proper table?

Someone have a simple example?

Fred

-----Original Message-----
From: Richard Heyes [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 06, 2004 5:52 PM
To: Will Leshner; [EMAIL PROTECTED]
Subject: Re: [sqlite] Determining an auto increment primary key


> On Mar 6, 2004, at 3:25 PM, Richard Heyes wrote:
>
> > Is there a de-facto method of determining if a column is an INTEGER
> > PRIMARY
> > KEY column (ie the auto increment type). Best I can come up with is
> > checking
> > the type and if it has a unique index on it, which isn't definitive
> > since it
> > could just be an integer column with a unique index.
> >
>
> I think if you do "PRAGMA table_info(<table>)" you get back a table of
> info for every column in the table. One of the fields is 'pk' and tells
> you whether or not that field is a primary key.

Sweet. Guess I should upgrade more often. :)

Thanks!
--
Richard Heyes

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to