/** * Connection-string rewrites for the tools Rebase shells out to. * * Pure and dependency-free: `pg-tools` builds argument vectors without a live * server, and these have to be usable from there. */ /** * Make a connection string safe to hand to a libpq program. * * `sslmode=no-verify` is a node-postgres convention — encrypt, but do not check * the certificate — and libpq does not have it. It does not degrade or warn: * * psql: error: invalid sslmode value: "no-verify" * * which means a `DATABASE_URL` that works perfectly for the app makes `psql`, * `pg_dump`, `pg_restore` and Atlas all refuse to start, with an error that * points at the value rather than at the convention it comes from. It has cost * this project time more than once. * * `require` is the honest translation: libpq's `require` encrypts and does not * verify the certificate either, which is exactly what `no-verify` asks for. * Nothing is relaxed by the rewrite — `verify-ca` and `verify-full` are left * alone, so a connection string that asked for verification still gets it. * * Only `sslmode` is touched, and only when it is a value libpq would reject. * Anything unparseable is returned as given: a connection that works * unverified beats one this corrupted. */ export declare function forLibpq(connectionString: string): string;