feat: fetch database connection tables in Settings/Integrations/Datab… (#4882)

…ase/Connection

Closes #4758

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
Thaïs
2024-04-09 14:22:15 +02:00
committed by GitHub
parent 19df43156e
commit 704f7f6d8e
21 changed files with 275 additions and 87 deletions

View File

@ -0,0 +1,15 @@
import { SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';
import { RemoteServer } from '~/generated-metadata/graphql';
type GetConnectionDbNameParams = {
integration: SettingsIntegration;
connection: RemoteServer;
};
export const getConnectionDbName = ({
integration,
connection,
}: GetConnectionDbNameParams) =>
integration.from.key === 'postgresql'
? connection.foreignDataWrapperOptions?.dbname
: '';