diff --git a/README.md b/README.md index c673baf..60f1578 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ data_sources: partitioningColumn: aggregate_id # Connect to a MySQL database - - id: postgres_source + - id: mysql_source description: Main events store type: mysql host: localhost @@ -71,6 +71,16 @@ data_sources: autoIncrementingColumn: id partitioningColumn: aggregate_id + # Use a plain text file as a data source. + # Each line must be a valid JSON object. + # Values are projected as they are added. + - id: file_source + description: My file JSON event store + type: file + path: ./path/to/source.file + incrementingField: id + partitioningField: aggregate_id + # Connections to your endpoint. # The Emulator will send data read from the databases to these endpoints. data_destinations: diff --git a/examples/config.yml b/examples/config.yml index 2a45380..54eb049 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -21,7 +21,7 @@ data_sources: partitioningColumn: aggregate_id # Connect to a MySQL database - - id: postgres_source + - id: mysql_source description: Main events store type: mysql host: localhost @@ -56,6 +56,16 @@ data_sources: autoIncrementingColumn: id partitioningColumn: aggregate_id + # Use a plain text file as a data source. + # Each line must be a valid JSON object. + # Values are projected as they are added. + - id: file_source + description: My file JSON event store + type: file + path: ./path/to/source.file + incrementingField: id + partitioningField: aggregate_id + # Connections to your endpoint. # The Emulator will send data read from the databases to these endpoints. data_destinations: diff --git a/tests/Test/Config.hs b/tests/Test/Config.hs index a7c4dec..caa6a87 100644 --- a/tests/Test/Config.hs +++ b/tests/Test/Config.hs @@ -45,6 +45,42 @@ testConfig = do description: The file source type: file path: ./source.txt + incrementingField: id + partitioningField: aggregate_id + + - id: mysql_source + description: Main events store + type: mysql + host: localhost + port: 5432 + username: my_user + password: my_pass + database: my_db + table: events_table + columns: + - id + - aggregate_id + - sequence_number + - payload + autoIncrementingColumn: id + partitioningColumn: aggregate_id + + - id: sqlserver_source + description: Main events store + type: sqlserver + host: localhost + port: 1433 + username: my_user + password: my_pass + database: my_db + table: events_table + columns: + - id + - aggregate_id + - sequence_number + - payload + autoIncrementingColumn: id + partitioningColumn: aggregate_id data_destinations: - id: file_destination @@ -55,6 +91,8 @@ testConfig = do sources: - postgres_source - file_source + - mysql_source + - sqlserver_source - id: HTTP_destination description: my projection 2 @@ -66,8 +104,10 @@ testConfig = do sources: - postgres_source - file_source + - mysql_source + - sqlserver_source |] - annotate "source count" $ Map.size (c_sources config) `shouldBe` 2 + annotate "source count" $ Map.size (c_sources config) `shouldBe` 4 annotate "source count" $ Map.size (c_destinations config) `shouldBe` 2 it "detects duplicate sources" $ do @@ -77,11 +117,15 @@ testConfig = do description: The file source type: file path: ./source.txt + incrementingField: id + partitioningField: aggregate_id - id: source_1 description: The file source type: file path: ./source.txt + incrementingField: id + partitioningField: aggregate_id data_destinations: - id: file_destination @@ -100,6 +144,8 @@ testConfig = do description: The file source type: file path: ./source.txt + incrementingField: id + partitioningField: aggregate_id data_destinations: - id: dest_1