如何在SQLite中获取有关外键的信息? [英] How do i get information about foreign keys in SQLite?

查看:236
本文介绍了如何在SQLite中获取有关外键的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sqlite_master表似乎缺少信息.我如何获得有关我的表的一些额外信息,例如约束信息等.有什么例子吗?还是那里有一些我从未听说过的有用的图书馆?

The sqlite_master table seems to lack information. How can i get some extra information about my tables like constraint information etc. Any examples? Or is there some usefull library out there that i`ve never heard off?

推荐答案

使用

PRAGMA foreign_key_list(table);

返回表的外键.

然后,您可以使用

PRAGMA foreign_key_check; 
PRAGMA foreign_key_check(table);

列出违规信息,而不是自己处理.

to list the violations, instead of doing it yourself.

这篇关于如何在SQLite中获取有关外键的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆