@@ -38,7 +38,7 @@ describe('streams', () => {
3838 expect ( desc . variants ) . toHaveLength ( 1 ) ;
3939 expect ( evaluateBucketIds ( desc , COMMENTS , { id : 'foo' } ) ) . toStrictEqual ( [ '1#stream|0[]' ] ) ;
4040 expect (
41- desc . dataSource
41+ desc . dataSources [ 0 ]
4242 . createDataSource ( { bucketIdTransformer } )
4343 . evaluateRow ( { sourceTable : USERS , record : { id : 'foo' } } )
4444 ) . toHaveLength ( 0 ) ;
@@ -747,7 +747,7 @@ describe('streams', () => {
747747 ) ;
748748 const row = { id : 'id' , account_id : 'account_id' } ;
749749
750- expect ( stream . dataSource . tableSyncsData ( accountMember ) ) . toBeTruthy ( ) ;
750+ expect ( stream . dataSources [ 0 ] . tableSyncsData ( accountMember ) ) . toBeTruthy ( ) ;
751751 expect ( stream . parameterLookupSources [ 0 ] . tableSyncsParameters ( accountMember ) ) . toBeTruthy ( ) ;
752752
753753 // Ensure lookup steps work.
@@ -779,7 +779,7 @@ describe('streams', () => {
779779
780780 // And that the data alias is respected for generated schemas.
781781 const outputSchema = { } ;
782- stream . dataSource . resolveResultSets ( schema , outputSchema ) ;
782+ stream . dataSources [ 0 ] . resolveResultSets ( schema , outputSchema ) ;
783783 expect ( Object . keys ( outputSchema ) ) . toStrictEqual ( [ 'outer' ] ) ;
784784 } ) ;
785785
@@ -937,16 +937,20 @@ const options: StreamParseOptions = {
937937const bucketIdTransformer = SqlSyncRules . versionedBucketIdTransformer ( '1' ) ;
938938
939939function evaluateBucketIds ( stream : SyncStream , sourceTable : SourceTableInterface , record : SqliteRow ) {
940- return stream . dataSource
941- . createDataSource ( { bucketIdTransformer } )
942- . evaluateRow ( { sourceTable, record } )
943- . map ( ( r ) => {
944- if ( 'error' in r ) {
945- throw new Error ( `Unexpected error evaluating row: ${ r . error } ` ) ;
946- }
940+ return stream . dataSources
941+ . map ( ( s ) =>
942+ s
943+ . createDataSource ( { bucketIdTransformer } )
944+ . evaluateRow ( { sourceTable, record } )
945+ . map ( ( r ) => {
946+ if ( 'error' in r ) {
947+ throw new Error ( `Unexpected error evaluating row: ${ r . error } ` ) ;
948+ }
947949
948- return r . bucket ;
949- } ) ;
950+ return r . bucket ;
951+ } )
952+ )
953+ . flat ( ) ;
950954}
951955
952956async function createQueriers (
0 commit comments