On Nov 22, 2010, at 7:26 PM, Simon Slavin wrote:

>> PRAGMA table_info(my_table) returns a row for each column in my_table.  Is 
>> it possible to do selects on this result set?
> 
> Nope.  The PRAGMA command does not present data to the SQL engine, it returns 
> results directly.  Grab the whole response and parse it using whatever 
> programming language you're using.

Yeah, that sucks :))

In any case, for the foolhardy or desperate, here is a feeble attempt to map 
the various SQLite pragma into a subset of information_schema [1]:

http://dev.alt.textdrive.com/browser/IMDB/Info.ddl

Support the following entities:

information_schema.catalog_name
information_schema.schemata
information_schema.tables
information_schema.columns
information_schema.table_constraints
information_schema.referential_constraints
information_schema.key_column_usage

Implemented as a Lua script [2]:

http://dev.alt.textdrive.com/browser/IMDB/Info.lua

As always, YMMV.

[1] http://en.wikipedia.org/wiki/Information_schema
[2] http://www.lua.org/about.html

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to