Package.json file
{
"dependencies": {
"@medusajs/admin-sdk": "2.22.7",
"@medusajs/cli": "2.22.7",
"@medusajs/framework": "2.22.7",
"@medusajs/medusa": "2.22.7"
}
}
Node.js version
v24.21.0
Database and its version
PostgreSQL 16 (postgres:16-alpine)
Operating system name and version
macOS 27.2.1
Browser name
No response
What happended?
databaseDriverOptions.dynamicPassword is meant to supply the database password from a function, so a short-lived credential can be refreshed for each new connection. On @medusajs/utils 2.22.7 that function never reaches the driver.
createPgConnection sets both connectionString and password. pg parses the URL and the parsed password overwrites the function, so the function is never called. A URL with no password becomes an empty string.
Migrations do not use that shared pool. mikroOrmCreateConnection copies connectionString into clientUrl. Passing host, user, database and the function, with no connection string, lets pg keep the function, but MikroORM then says no database was specified. loadDatabaseConfig also rejects that configuration because clientUrl is missing.
This is the same bug as #16200, which the stale bot closed on 13 October 2026. #16201 and #17174 were closed without being merged. I checked and on develop and both still pass a connection string through.