BREAKING CHANGE: Removing remote integration feature (#17001)

## Context
The feature has not been maintained for more than a year and was never
officially launched.
This PR removes its code due to the upcoming refactoring of the
sync-metadata that will break its logic if not handled properly and it
would be too costly for the time being.

TODO:
- remove isRemote from object/field metadata
This commit is contained in:
Weiko
2026-01-08 10:14:51 +01:00
committed by GitHub
parent 2e0eeda52e
commit 66b2882ac4
106 changed files with 24 additions and 5202 deletions
@@ -1,5 +0,0 @@
import { ForeignDataWrapperServerQueryFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/foreign-data-wrapper-server-query.factory';
export const workspaceQueryBuilderFactories = [
ForeignDataWrapperServerQueryFactory,
];
@@ -1,69 +0,0 @@
import { Injectable } from '@nestjs/common';
import {
type ForeignDataWrapperOptions,
type RemoteServerType,
} from 'src/engine/metadata-modules/remote-server/remote-server.entity';
import { type UserMappingOptions } from 'src/engine/metadata-modules/remote-server/types/user-mapping-options';
@Injectable()
export class ForeignDataWrapperServerQueryFactory {
createForeignDataWrapperServer(
foreignDataWrapperId: string,
foreignDataWrapperType: RemoteServerType,
foreignDataWrapperOptions: ForeignDataWrapperOptions<RemoteServerType>,
) {
const options = this.buildQueryOptions(foreignDataWrapperOptions, false);
return `CREATE SERVER "${foreignDataWrapperId}" FOREIGN DATA WRAPPER ${foreignDataWrapperType} OPTIONS (${options})`;
}
updateForeignDataWrapperServer({
foreignDataWrapperId,
foreignDataWrapperOptions,
}: {
foreignDataWrapperId: string;
foreignDataWrapperOptions: Partial<
ForeignDataWrapperOptions<RemoteServerType>
>;
}) {
const options = this.buildQueryOptions(foreignDataWrapperOptions, true);
return `ALTER SERVER "${foreignDataWrapperId}" OPTIONS (${options})`;
}
createUserMapping(
foreignDataWrapperId: string,
userMappingOptions: UserMappingOptions,
) {
const options = this.buildQueryOptions(userMappingOptions, false);
// CURRENT_USER works for now since we are using only one user. But if we switch to a user per workspace, we need to change this.
return `CREATE USER MAPPING IF NOT EXISTS FOR CURRENT_USER SERVER "${foreignDataWrapperId}" OPTIONS (${options})`;
}
updateUserMapping(
foreignDataWrapperId: string,
userMappingOptions: Partial<UserMappingOptions>,
) {
const options = this.buildQueryOptions(userMappingOptions, true);
// CURRENT_USER works for now since we are using only one user. But if we switch to a user per workspace, we need to change this.
return `ALTER USER MAPPING FOR CURRENT_USER SERVER "${foreignDataWrapperId}" OPTIONS (${options})`;
}
private buildQueryOptions(
options:
| ForeignDataWrapperOptions<RemoteServerType>
| Partial<ForeignDataWrapperOptions<RemoteServerType>>
| UserMappingOptions
| Partial<UserMappingOptions>,
isUpdate: boolean,
) {
const prefix = isUpdate ? 'SET ' : '';
return Object.entries(options)
.map(([key, value]) => `${prefix}${key} '${value}'`)
.join(', ');
}
}
@@ -1,12 +0,0 @@
import { Module } from '@nestjs/common';
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
import { workspaceQueryBuilderFactories } from './factories/factories';
@Module({
imports: [ObjectMetadataModule],
providers: [...workspaceQueryBuilderFactories],
exports: [],
})
export class WorkspaceQueryBuilderModule {}
@@ -1,7 +1,6 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { WorkspaceQueryBuilderModule } from 'src/engine/api/graphql/workspace-query-builder/workspace-query-builder.module';
import { TelemetryListener } from 'src/engine/api/graphql/workspace-query-runner/listeners/telemetry.listener';
import { WorkspaceQueryHookModule } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/workspace-query-hook.module';
import { AuditModule } from 'src/engine/core-modules/audit/audit.module';
@@ -19,7 +18,6 @@ import { EntityEventsToDbListener } from './listeners/entity-events-to-db.listen
@Module({
imports: [
AuthModule,
WorkspaceQueryBuilderModule,
WorkspaceDataSourceModule,
WorkspaceQueryHookModule,
TypeOrmModule.forFeature([FeatureFlagEntity]),