pgaddress
Flexible address parser for Lakebase Postgres connection inputs.
Accepts whatever shape a user is likely to paste into
LAKEBASE_ENDPOINT (or the matching config field) and extracts
every recognizable piece. Whatever it can’t recover is left for the
Lakebase resolver to discover.
Recognized formats:
-
Postgres URI -
postgresql://user@host:port/db?sslmode=require(alsopostgres://). Yieldsuser,host,port,database,sslMode. -
Canonical endpoint resource path -
projects/{p}/branches/{b}/endpoints/{e}- yieldsproject,branch,endpointId, and the original string asendpoint(already in lakebase’s expected form). -
Database resource path -
projects/{p}/branches/{b}/databases/{d}- yieldsproject,branch, anddatabaseResourceId(the UC resource leaf, notPGDATABASE; the resolver looks up the real Postgres name via REST). -
Branch resource path -
projects/{p}/branches/{b}- yieldsproject,branch. -
Project resource path -
projects/{p}- yieldsproject. -
Bare hostname -
ep-steep-forest-e199v43w.database.eastus2.azuredatabricks.net- yieldshostonly; the resolver reverse-looks up the owning endpoint to recover the resource path. -
Bare project id -
dbx-tools-demo(1-63 chars, lowercase letters/digits/hyphens) - yieldsproject.
Returns an empty object for inputs it doesn’t recognize.