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,20 +5,21 @@ 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 }
: {
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,
@ -43,8 +44,7 @@ export const generateConnectionInfo = (
from_env: values.sslSettings?.sslPassword,
},
},
};
};
});
export const generatePostgresRequestPayload = ({
driver,