Skip to content

Commit

Permalink
Rename datasources to just source and target
Browse files Browse the repository at this point in the history
The `reactive-` prefix is redundant, that's all we support right now, and is implied by the `r2dbc` prefix
  • Loading branch information
chadlwilson committed Nov 10, 2021
1 parent b4ea55f commit 7cd43ea
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
r2dbc:
datasources:
reactive-source:
source:
url: r2dbc:pool:postgresql://source-db:5432/db
username: user
password: password
options: {}
reactive-target:
target:
url: r2dbc:pool:postgresql://target-db:5432/db
username: user
password: password
Expand All @@ -14,21 +14,21 @@ reconciliation:
datasets:
raw:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: >
select id as MigrationKey, *
from big_table
target:
dataSourceRef: reactive-target
dataSourceRef: target
query: >
select id as MigrationKey, *
from big_table
counts:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: >
select 'Num rows' as MigrationKey, count(*) from big_table
target :
dataSourceRef: reactive-target
dataSourceRef: target
query: >
select 'Num rows' as MigrationKey, count(*) from big_table
16 changes: 8 additions & 8 deletions examples/scenario/petshop-mysql/application-petshop-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
r2dbc:
datasources:
reactive-source:
source:
url: r2dbc:pool:mysql://source-db:3306/db
username: user
password: password
options: {}
reactive-target:
target:
url: r2dbc:pool:mysql://target-db:3306/db
username: user
password: password
Expand All @@ -14,18 +14,18 @@ reconciliation:
datasets:
pets:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: >
select pet.id as MigrationKey, category, name, status
from pet
target:
dataSourceRef: reactive-target
dataSourceRef: target
query: >
select pet.id as MigrationKey, category.name, pet.name, status
from pet inner join category on pet.category_id = category.id
order-status:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: >
select
order_status.id as MigrationKey,
Expand All @@ -39,7 +39,7 @@ reconciliation:
complete
from order_status
target:
dataSourceRef: reactive-target
dataSourceRef: target
query: >
select
order_status.id as MigrationKey,
Expand All @@ -50,10 +50,10 @@ reconciliation:
from order_status inner join pet on order_status.pet_id = pet.id
categories:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: >
select "# Categories" as MigrationKey, count(distinct category) from pet
target :
dataSourceRef: reactive-target
dataSourceRef: target
query: >
select "# Categories" as MigrationKey, count(*) from category
12 changes: 6 additions & 6 deletions src/test/kotlin/recce/server/RecConfigurationPropertiesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ internal class RecConfigurationPropertiesTest {
@BeforeEach
fun setUp() {
items["flyway.datasources.default.enabled"] = false
items["r2dbc.datasources.reactive-source.url"] =
items["r2dbc.datasources.source.url"] =
"r2dbc:h2:mem:///sourceDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
items["r2dbc.datasources.reactive-target.url"] =
items["r2dbc.datasources.target.url"] =
"r2dbc:h2:mem:///targetDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
items["reconciliation.datasets.test-dataset.source.dataSourceRef"] = "reactive-source"
items["reconciliation.datasets.test-dataset.source.dataSourceRef"] = "source"
items["reconciliation.datasets.test-dataset.source.query"] = "select count(*) as sourcedatacount from testdata"
items["reconciliation.datasets.test-dataset.target.dataSourceRef"] = "reactive-target"
items["reconciliation.datasets.test-dataset.target.dataSourceRef"] = "target"
items["reconciliation.datasets.test-dataset.target.query"] = "select count(*) as targetdatacount from testdata"
}

Expand All @@ -34,10 +34,10 @@ internal class RecConfigurationPropertiesTest {
.hasSize(1)
.first().satisfies {
Assertions.assertThat(it.name).isEqualTo("test-dataset")
Assertions.assertThat(it.source.dataSourceRef).isEqualTo("reactive-source")
Assertions.assertThat(it.source.dataSourceRef).isEqualTo("source")
Assertions.assertThat(it.source.query).contains("sourcedatacount")
Assertions.assertThat(it.source.dbOperations).isNotNull
Assertions.assertThat(it.target.dataSourceRef).isEqualTo("reactive-target")
Assertions.assertThat(it.target.dataSourceRef).isEqualTo("target")
Assertions.assertThat(it.target.query).contains("targetdatacount")
Assertions.assertThat(it.target.dbOperations).isNotNull
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/recce/server/RecConfigurationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ internal class RecConfigurationTest {
.hasSize(1)
.hasEntrySatisfying("test-dataset") {
assertThat(it.name).isEqualTo("test-dataset")
assertThat(it.source.dataSourceRef).isEqualTo("reactive-source")
assertThat(it.source.dataSourceRef).isEqualTo("source")
assertThat(it.source.query).contains("select name as MigrationKey")
assertThat(it.source.dbOperations).isNotNull
assertThat(it.target.dataSourceRef).isEqualTo("reactive-target")
assertThat(it.target.dataSourceRef).isEqualTo("target")
assertThat(it.target.query).contains("select name as MigrationKey")
assertThat(it.target.dbOperations).isNotNull
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import reactor.test.StepVerifier
@MicronautTest(environments = arrayOf("test-integration"))
class ReactiveDataSourceTest : DataSourceTest() {
@Inject
@field:Named("reactive-source")
@field:Named("source")
private lateinit var sourceOperations: R2dbcOperations

@Inject
@field:Named("reactive-target")
@field:Named("target")
private lateinit var targetOperations: R2dbcOperations

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/application-test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ datasources:
password: ''
r2dbc:
datasources:
reactive-source:
source:
url: r2dbc:pool:h2:mem:///sourceDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
reactive-target:
target:
url: r2dbc:pool:h2:mem:///targetDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
6 changes: 3 additions & 3 deletions src/test/resources/config/application-test-dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ reconciliation:
datasets:
test-dataset:
source:
dataSourceRef: reactive-source
dataSourceRef: source
query: select name as MigrationKey, name, value from testdata
target:
dataSourceRef: reactive-target
query: select name as MigrationKey, name, value from testdata
dataSourceRef: target
query: select name as MigrationKey, name, value from testdata

0 comments on commit 7cd43ea

Please sign in to comment.