We should not depend on the foreign data wrapper type to manage distant table. The remote server should be enough to handle the table creation. Here is the new flow to fetch available tables: - check if the remote server have available tables already stored - if not, import full schema in a temporary schema - copy the tables into the available tables field - delete the schema Left todo: - update remote server input for postgres so we receive the schema --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
17 lines
659 B
TypeScript
17 lines
659 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
|
|
import { RemoteServerEntity } from 'src/engine/metadata-modules/remote-server/remote-server.entity';
|
|
import { DistantTableService } from 'src/engine/metadata-modules/remote-server/remote-table/distant-table/distant-table.service';
|
|
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
WorkspaceDataSourceModule,
|
|
TypeOrmModule.forFeature([RemoteServerEntity], 'metadata'),
|
|
],
|
|
providers: [DistantTableService],
|
|
exports: [DistantTableService],
|
|
})
|
|
export class DistantTableModule {}
|