PostgreSQL miner app
The PostgreSQL miner app mines query history from PostgreSQL to generate lineage and
usage metrics. Build it with the PostgresMiner builder.
A miner does not create a connection or take a credential—it runs on an
existing PostgreSQL connection and reuses that connection's own credential, so
you only supply the connection's qualifiedName.
Source extraction
- Python
Mine query history from PostgreSQL
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.apps import PostgresMiner
client = AtlanClient()
response = (
PostgresMiner(client)
.connection( # (1)
qualified_name="default/postgres/1700000000",
)
.run(name="postgres-prod-miner") # (2)
)
print(response.slug, response.run_id)
- Required. The exact
qualifiedNameof the existing PostgreSQL connection to mine. The builder resolves that connection's credential automatically—no credential step is needed. - Always pass an explicit
namefor miners. A miner has no connection display name to derive one from, so a bare.run()defaults the workflow name to the app id (postgres-miner) and a second run collides (409 already exists).