import type { ConnectionOptions } from 'node:tls'; import type { PoolConfig } from 'pg'; /** * Builds the `pg.Pool` options for a connection-string based config. * * Shared by both `PostgresStore` and `PgVector` so connection-string SSL * precedence behaves identically across the storage and vector code paths. * * node-postgres re-parses `connectionString` via `pg-connection-string` and * `Object.assign`s the parsed result over any explicit options. As a result an * `sslmode=` / `ssl=` query param in the URL silently overrides an explicit * `ssl` object (e.g. `{ rejectUnauthorized: false }`), producing * `UNABLE_TO_GET_ISSUER_CERT_LOCALLY` against self-signed CAs even though the * caller asked to skip verification. * * To avoid that we parse the connection string ourselves and forward the * discrete fields, applying the explicit `ssl` last so it always wins. When no * explicit `ssl` is provided we keep whatever the URL implied (`sslmode=...`), * preserving backwards-compatible behaviour for connection-string-only SSL. * * @see https://github.com/mastra-ai/mastra/issues/17307 */ export declare function buildConnectionStringPoolConfig(config: { connectionString: string; ssl?: ConnectionOptions | boolean; max?: number; idleTimeoutMillis?: number; }, defaults: { max: number; idleTimeoutMillis: number; }): PoolConfig; //# sourceMappingURL=pool-config.d.ts.map