On 10 Dec 2010, at 10:51pm, BareFeetWare wrote: > Could you please consider taking it further, providing foreign keys via a > select query instead of a pragma? SQLite currently provides limited > introspection, some via select * from SQLite_Master and some via pragmas. Of > the two, select is far more useful, since it can be filtered directly and > joined with other tables. > > For instance, if foreign keys could be accessed via select, we could get all > the foreign keys for a given column via one statement: > > select * from SQLite_Foreign_Keys where To_Table = 'My Table' and To_Column = > 'My Column';
The problem with foreign keys (and triggers !) as separate rows of SQLITE_MASTER is that it would all have to be one long string, so you'd have to write a parser. I think a better idea would be to expand table_info with a second parameter so it could list all tables, and report on columns, indexes, triggers and foreign keys all in one PRAGMA. Then all the other PRAGMAs that do this could be removed. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users