Years ago I wrote something similar for PostgreSQL. Unlike SQLite, it supports[1] the much richer "information_schema" database schema that's defined by the SQL standard. As long as you can figure out how it represents tables, columns, and primary and foreign keys, it shouldn't be too difficult to adapt this SQL query to fit. After all, reshaping relational data to extract the information you need is what SQL is for.
My project pdot^1 has a full-ERD mode but it's honestly less useful than the semi-interactive/contextual mode of navigating schema subgraphs in a database of any size. pdot can output mermaid and render other graphs too, like trigger cascades and grant inheritance.
thristian|1 year ago
[1]: https://www.postgresql.org/docs/current/information-schema.h...
ccakes|1 year ago
Covers a lot of different platforms incl Postgres
[1] https://github.com/k1LoW/tbls
Vuizur|1 year ago
dmfay|1 year ago
^1 https://gitlab.com/dmfay/pdot