Foreign key information is highly useful in many different ORM systems
in many different languages.

My personal example, the "An ORM for any SQLite database in one line
of code" ORLite module in Perl.

http://search.cpan.org/perldoc?ORLite

It is expected to generate entire class trees for any arbitrary
database unassisted with just

use ORLite 'mydatabase.sqlite';

It uses introspection of the foreign key information to generate code
which allows something like the following to return a different object
instead of just the id.

$child->father

Right now I'm doing some extremely fragile SQL parsing but was about
to switch over to the more reliable pragma. I'd dearly love to
continue to be able to.

That said, I don't specifically need it to be a pragma, just as long
as there's some place to get the information instead of writing my own
SQL parser. Somewhere in a sqlite__columns table would be totally fine
too.

In summary, the enforcement of foreign key constraints is not the only
use case for the pragma. While the enforcement use case is now
removed, the rest still remain.

Adam K

On 9 December 2010 06:44, Richard Hipp <[email protected]> wrote:
> On Wed, Dec 8, 2010 at 2:35 PM, Petite Abeille 
> <[email protected]>wrote:
>
>> Hello,
>>
>> The pragma foreign_key_list appears to be deprecated in 3.7.4:
>>
>> http://www.sqlite.org/pragma.html#pragma_foreign_key_list
>>
>> Any reason for such deprecation?
>>
>
> Now that foreign key constraints are enforced natively, why would you want
> to have a list of them?  Why should the foreign_key_list pragma continue to
> consume code space and developer maintenance time?
>
>
>
>>
>> What's the alternative to that pragma to achieve the same effect?
>>
>> Thanks in advance.
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> [email protected]
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to