"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDatabaseUrl = parseDatabaseUrl;
function parseDatabaseUrl(url) {
    const parsed = new URL(url);
    return {
        host: parsed.hostname,
        port: parsed.port ? parseInt(parsed.port, 10) : 3306,
        username: decodeURIComponent(parsed.username),
        password: decodeURIComponent(parsed.password),
        database: parsed.pathname.replace(/^\//, ''),
    };
}
//# sourceMappingURL=parse-database-url.js.map