2 ms·
You can do this a little bit easier using SQLPage [1], without GraphViz, and you'll get an always up to date schema: select 'table' as component, 'Foreign
by lovasoa 3y ago
You can do this a little bit easier using SQLPage [1], without GraphViz, and you'll get an always up to date schema:
select 'table' as component, 'Foreign keys' as markdown;
select *, (
select
group_concat(
printf('[%s.%s](?table=%s)', fk."table",fk."to",fk."table"),
', '
)
from pragma_foreign_key_list($table) fk
where col.name = fk."from"
) as "Foreign keys"
from pragma_table_info($table) col;
[1] https://sql.ophir.dev https://sql.ophir.dev (https://github.com/lovasoa/SQLpage#sqlpage https://github.com/lovasoa/SQLpage#sqlpage)
- vidarh 3y agoI don't see how this is in any way comparable - it looks like it'd just produces a table rather than a diagram? You can indeed do that too with a single sqlite query as well if it's not the diagram you want. Nor how running some other tool that runs a web service qualifies as "easier" than running a query using sqlite itself, and a command line tool that's trivially scriptable.