Skip to content

Commit 18bc3bf

Browse files
committed
Move debugRepresentation() back to BucketSource.
1 parent ddcb8a0 commit 18bc3bf

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

packages/sync-rules/src/BucketSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export interface BucketSource {
5151
* The same source could in theory be present in multiple stream definitions.
5252
*/
5353
readonly parameterLookupSources: BucketParameterLookupSourceDefinition[];
54+
55+
debugRepresentation(): any;
5456
}
5557

5658
export interface HydratedBucketSource {
@@ -80,8 +82,6 @@ export interface BucketDataSourceDefinition {
8082
resolveResultSets(schema: SourceSchema, tables: Record<string, Record<string, ColumnDefinition>>): void;
8183

8284
debugWriteOutputTables(result: Record<string, { query: string }[]>): void;
83-
84-
debugRepresentation(): any;
8585
}
8686

8787
/**

packages/sync-rules/src/SqlSyncRules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ export class SqlSyncRules {
473473
}
474474

475475
debugRepresentation() {
476-
return this.bucketDataSources.map((rules) => rules.debugRepresentation());
476+
return this.bucketSources.map((rules) => rules.debugRepresentation());
477477
}
478478

479479
private parsePriority(value: YAMLMap) {

packages/sync-rules/src/streams/stream.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ export class SyncStream implements BucketSource {
5353
public get type(): BucketSourceType {
5454
return BucketSourceType.SYNC_STREAM;
5555
}
56+
57+
debugRepresentation() {
58+
return {
59+
name: this.name,
60+
type: BucketSourceType[BucketSourceType.SYNC_STREAM],
61+
variants: this.variants.map((v) => v.debugRepresentation()),
62+
data: {
63+
table: this.data.sourceTable,
64+
columns: this.data.columnOutputNames()
65+
}
66+
};
67+
}
5668
}
5769

5870
export class SyncStreamDataSource implements BucketDataSourceDefinition {
@@ -90,18 +102,6 @@ export class SyncStreamDataSource implements BucketDataSourceDefinition {
90102
result[this.data.table!.sqlName].push(r);
91103
}
92104

93-
debugRepresentation() {
94-
return {
95-
name: this.stream.name,
96-
type: BucketSourceType[BucketSourceType.SYNC_STREAM],
97-
variants: this.stream.variants.map((v) => v.debugRepresentation()),
98-
data: {
99-
table: this.data.sourceTable,
100-
columns: this.data.columnOutputNames()
101-
}
102-
};
103-
}
104-
105105
createDataSource(params: CreateSourceParams): BucketDataSource {
106106
return {
107107
evaluateRow: (options: EvaluateRowOptions): EvaluationResult[] => {

0 commit comments

Comments
 (0)