console: bugfix to resolve error when using connection parameters with postgres/citus

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9465
GitOrigin-RevId: 8ee65b734314e6bfc7bd2806dc0ba77334e30c5c
This commit is contained in:
Matthew Goodwin 2023-06-07 16:48:33 -05:00 committed by hasura-bot
parent 4613aaf56e
commit dc7a1f2270

View File

@ -5,46 +5,46 @@ import { cleanEmpty } from './helpers';
export const generateConnectionInfo = (
values: PostgresConnectionSchema['configuration']['connectionInfo']
) => {
return {
database_url:
values.databaseUrl.connectionType === 'databaseUrl'
? values.databaseUrl.url
: values.databaseUrl.connectionType === 'envVar'
? { from_env: values.databaseUrl.envVar }
: {
) => ({
database_url:
values.databaseUrl.connectionType === 'databaseUrl'
? values.databaseUrl.url
: values.databaseUrl.connectionType === 'envVar'
? { from_env: values.databaseUrl.envVar }
: {
connection_parameters: {
username: values.databaseUrl.username,
password: values.databaseUrl.password,
database: values.databaseUrl.database,
port: values.databaseUrl.port,
host: values.databaseUrl.host,
},
pool_settings: {
total_max_connections: values.poolSettings?.totalMaxConnections,
idle_timeout: values.poolSettings?.idleTimeout,
retries: values.poolSettings?.retries,
pool_timeout: values.poolSettings?.poolTimeout,
connection_lifetime: values.poolSettings?.connectionLifetime,
},
pool_settings: {
total_max_connections: values.poolSettings?.totalMaxConnections,
idle_timeout: values.poolSettings?.idleTimeout,
retries: values.poolSettings?.retries,
pool_timeout: values.poolSettings?.poolTimeout,
connection_lifetime: values.poolSettings?.connectionLifetime,
},
use_prepared_statements: values.usePreparedStatements,
isolation_level: values.isolationLevel,
ssl_configuration: {
sslmode: values.sslSettings?.sslMode,
sslrootcert: {
from_env: values.sslSettings?.sslRootCert,
},
use_prepared_statements: values.usePreparedStatements,
isolation_level: values.isolationLevel,
ssl_configuration: {
sslmode: values.sslSettings?.sslMode,
sslrootcert: {
from_env: values.sslSettings?.sslRootCert,
},
sslcert: {
from_env: values.sslSettings?.sslCert,
},
sslkey: {
from_env: values.sslSettings?.sslKey,
},
sslpassword: {
from_env: values.sslSettings?.sslPassword,
},
sslcert: {
from_env: values.sslSettings?.sslCert,
},
};
};
sslkey: {
from_env: values.sslSettings?.sslKey,
},
sslpassword: {
from_env: values.sslSettings?.sslPassword,
},
},
});
export const generatePostgresRequestPayload = ({
driver,