@@ -48,7 +48,13 @@ export class HydratedSyncConfig {
4848 eventDescriptors : SqlEventDescriptor [ ] = [ ] ;
4949 compatibility : CompatibilityContext = CompatibilityContext . FULL_BACKWARDS_COMPATIBILITY ;
5050
51- readonly definitions : SyncConfig [ ] ;
51+ /**
52+ * The source definitions.
53+ *
54+ * For most functionality, we don't use these directly, but rather use the
55+ * merged definitions such as bucketDataSources.
56+ */
57+ private readonly sourceDefinitions : SyncConfig [ ] ;
5258
5359 /**
5460 * Bucket data sources from underlying SyncConfig definitions.
@@ -76,8 +82,8 @@ export class HydratedSyncConfig {
7682 throw new Error ( 'HydratedSyncRules requires at least one SyncConfig definition' ) ;
7783 }
7884
79- this . definitions = [ ...definitions ] ;
80- this . compatibility = assertSharedCompatibility ( this . definitions ) ;
85+ this . sourceDefinitions = [ ...definitions ] ;
86+ this . compatibility = assertSharedCompatibility ( this . sourceDefinitions ) ;
8187
8288 this . bucketDataSources = uniqueBy (
8389 definitions . flatMap ( ( definition ) => definition . bucketDataSources ) ,
@@ -107,22 +113,22 @@ export class HydratedSyncConfig {
107113
108114 getSourceTables ( ) {
109115 const sourceTables = new Map < string , TablePattern > ( ) ;
110- for ( const definition of this . definitions ) {
116+ for ( const definition of this . sourceDefinitions ) {
111117 definition . writeSourceTables ( sourceTables ) ;
112118 }
113119 return [ ...sourceTables . values ( ) ] ;
114120 }
115121
116122 tableTriggersEvent ( table : SourceTableRef ) : boolean {
117- return this . definitions . some ( ( definition ) => definition . tableTriggersEvent ( table ) ) ;
123+ return this . sourceDefinitions . some ( ( definition ) => definition . tableTriggersEvent ( table ) ) ;
118124 }
119125
120126 tableSyncsData ( table : SourceTableRef ) : boolean {
121- return this . definitions . some ( ( definition ) => definition . tableSyncsData ( table ) ) ;
127+ return this . sourceDefinitions . some ( ( definition ) => definition . tableSyncsData ( table ) ) ;
122128 }
123129
124130 tableSyncsParameters ( table : SourceTableRef ) : boolean {
125- return this . definitions . some ( ( definition ) => definition . tableSyncsParameters ( table ) ) ;
131+ return this . sourceDefinitions . some ( ( definition ) => definition . tableSyncsParameters ( table ) ) ;
126132 }
127133
128134 getMatchingSources ( source : SourceTableRef ) : MatchingSources {
@@ -221,7 +227,7 @@ export class HydratedSyncConfig {
221227 }
222228
223229 getBucketParameterQuerier ( options : GetQuerierOptions ) : GetBucketParameterQuerierResult {
224- if ( this . definitions . length != 1 ) {
230+ if ( this . sourceDefinitions . length != 1 ) {
225231 throw new Error ( 'getBucketParameterQuerier() is not supported for HydratedSyncRules with multiple SyncConfigs' ) ;
226232 }
227233
0 commit comments