Database Explorer 0.1.0: The admin table browser becomes its own package
Database Explorer 0.1.0 gives a PhoenixKit site a read-only look at its Postgres database from the admin: every table with its size, the rows of any table, and a live feed of inserts, updates and deletes.
What it shows
The module adds a DB section to the admin at /admin/db. The overview lists the tables with row counts and sizes, with totals for Tables, Rows, Tables Size and Database Size, and a search by schema or table name. Opening a table shows its rows 50 at a time, with search, and the rows refresh as they change.
The Activity tab, at /admin/db/activity, shows every insert, update and delete on the watched tables as it happens, with the changed values highlighted. Pause holds the feed while events keep being counted, and Clear empties it.
Live updates use Postgres LISTEN/NOTIFY. A trigger is added to a table the first time it is viewed, and one listener connection passes the changes on to open pages.
Where it came from
The explorer used to live inside PhoenixKit core. It is now a separate package, phoenix_kit_db, found by PhoenixKit when installed. Access needs the db permission, which Owner and Admin have; other roles can be given it in the roles matrix.
Upgrading
Add {:phoenix_kit_db, "~> 0.1.0"} to your dependencies. It needs PhoenixKit 1.7. The on/off setting is renamed from db_explorer_enabled to db_enabled, and the old one is not read, so turn the module on again under Modules if you used the explorer in core.
Database Explorer 0.1.0. Install or update: {:phoenix_kit_db, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.