A PostgreSQL database scanner that discovers structure, maps types, and detects enums.
Summary
Functions
Scans a PostgreSQL database and returns its structure.
Functions
Scans a PostgreSQL database and returns its structure.
Accepts connection params as a keyword list:
EctoDBScanner.scan(
hostname: "localhost",
username: "postgres",
password: "postgres",
database: "my_db",
port: 5432
)Options
:analyze(boolean, defaulttrue) — RunsANALYZEagainst the target database before scanning so planner statistics (notablypg_class.reltuples, used for row counts and enum detection sampling) are fresh. On large databases this may take a while; set tofalseif stats are already current or the connecting role lacks permission.
All other options are passed through to the underlying repo connection.
Returns {:ok, %EctoDBScanner.Result.Database{}} or {:error, reason}.