mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-25 07:44:48 +00:00
Review (maestro #510): batch and CDC tables are both removed through DELETE /pipeline/{id}/jobs (the platform dispatches by type: Airflow refresh vs Kafka Connect reconfigure), so the connector 'if' in the controller is gone. deleteTable/deleteTables/addTable are now thin controller methods over PipelineTablesService (mark -> resolve jobs -> platform -> rollback), with typed request bodies. Behavior change for batch: the platform refuses to remove the LAST table of a pipeline (400 'Cannot remove all jobs'), where DELETE /jobs/{id} allowed it. Co-Authored-By: WOZCODE <contact@withwoz.com>
67 lines
1.6 KiB
TypeScript
67 lines
1.6 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class ValidationTableDTO {
|
|
@ApiProperty()
|
|
tables: Array<{
|
|
table_name: string;
|
|
table_schema: string;
|
|
}>;
|
|
}
|
|
|
|
export class DeleteTableBody {
|
|
@ApiProperty()
|
|
table_name: string;
|
|
}
|
|
|
|
export class DeleteTablesBody {
|
|
@ApiProperty({ type: [String] })
|
|
table_names: string[];
|
|
}
|
|
|
|
export class CdcTableDestination {
|
|
@ApiProperty()
|
|
table_schema: string;
|
|
@ApiProperty()
|
|
table_name: string;
|
|
}
|
|
|
|
export class CdcTableDestinations {
|
|
@ApiProperty({ type: CdcTableDestination })
|
|
raw: CdcTableDestination;
|
|
@ApiProperty({ type: CdcTableDestination })
|
|
qualify: CdcTableDestination;
|
|
}
|
|
|
|
export class CdcColumnBody {
|
|
@ApiProperty()
|
|
name: string;
|
|
@ApiProperty()
|
|
type: string;
|
|
@ApiProperty()
|
|
is_primary_key: boolean;
|
|
}
|
|
|
|
export class AddCdcTableBody {
|
|
@ApiProperty()
|
|
table_name: string;
|
|
@ApiProperty()
|
|
table_schema: string;
|
|
@ApiProperty({ type: [String] })
|
|
primary_keys: string[];
|
|
@ApiProperty({ type: CdcTableDestinations })
|
|
destinations: CdcTableDestinations;
|
|
// Iceberg destination only (protospack CdcTable.iceberg_table_name);
|
|
// absent for snowflake, back-compat.
|
|
@ApiPropertyOptional()
|
|
iceberg_table_name?: string;
|
|
// Per-table deduped (qualify) Iceberg table name; absent => same as raw.
|
|
@ApiPropertyOptional()
|
|
iceberg_qualify_table_name?: string;
|
|
// Source column schema for iceberg deduped table pre-create.
|
|
@ApiPropertyOptional({ type: [CdcColumnBody] })
|
|
columns?: CdcColumnBody[];
|
|
// Columns the user chose to ignore -> Debezium column.exclude.list.
|
|
@ApiPropertyOptional({ type: [String] })
|
|
column_exclude_list?: string[];
|
|
}
|