Sync remote object (#4713)
* Sync objects * Generate data for isRemote * Add cache version update * Add label identifier + fix field metadata input --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
import { decryptText } from 'src/engine/core-modules/auth/auth.util';
|
||||
import {
|
||||
RemoteServerEntity,
|
||||
RemoteServerType,
|
||||
} from 'src/engine/metadata-modules/remote-server/remote-server.entity';
|
||||
|
||||
export const EXCLUDED_POSTGRES_SCHEMAS = [
|
||||
'information_schema',
|
||||
'pg_catalog',
|
||||
'pg_toast',
|
||||
];
|
||||
|
||||
export const buildPostgresUrl = (
|
||||
secretKey: string,
|
||||
remoteServer: RemoteServerEntity<RemoteServerType>,
|
||||
): string => {
|
||||
const foreignDataWrapperOptions = remoteServer.foreignDataWrapperOptions;
|
||||
const userMappingOptions = remoteServer.userMappingOptions;
|
||||
|
||||
const password = decryptText(userMappingOptions.password, secretKey);
|
||||
|
||||
const url = `postgres://${userMappingOptions.username}:${password}@${foreignDataWrapperOptions.host}:${foreignDataWrapperOptions.port}/${foreignDataWrapperOptions.dbname}`;
|
||||
|
||||
return url;
|
||||
};
|
||||
Reference in New Issue
Block a user