mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Added unit tests for inspect() foreign key detection
Used them to fix a bug with it. Refs #85
This commit is contained in:
parent
e16ca1169c
commit
45e502aace
2 changed files with 77 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ def get_all_foreign_keys(conn):
|
|||
for table in tables:
|
||||
infos = conn.execute(
|
||||
'PRAGMA foreign_key_list([{}])'.format(table)
|
||||
).fetchmany()
|
||||
).fetchall()
|
||||
for info in infos:
|
||||
if info is not None:
|
||||
id, seq, table_name, from_, to_, on_update, on_delete, match = info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue