diff --git a/.github/workflows/ci.yml b/.github/workflows/build-timestamped-master.yml similarity index 85% rename from .github/workflows/ci.yml rename to .github/workflows/build-timestamped-master.yml index dd6df4b..ad6bb0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -5,8 +5,7 @@ on: branches: - main - 2201.[0-9]+.x - repository_dispatch: - types: check_connector_for_breaking_changes + workflow_dispatch: jobs: call_workflow: diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index bb549e9..6fbf394 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -13,7 +13,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main secrets: inherit with: - additional-build-flags: -x :cdc-examples:build + additional_windows_build_flags: -x test diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 2ddc187..da3a313 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -13,4 +13,4 @@ jobs: with: repo-name: module-ballerinax-cdc additional-build-flags: -x :cdc-examples:build - \ No newline at end of file + additional-test-flags: -x :cdc-compiler-plugin-tests:test diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4a6bfb0..d8a4e5f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,8 +10,8 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit with: - additional-build-flags: -x :cdc-examples:build - \ No newline at end of file + additional-ubuntu-build-flags: -x :cdc-examples:build + additional-windows-test-flags: -x test diff --git a/README.md b/README.md index ff8df20..fe3d785 100644 --- a/README.md +++ b/README.md @@ -17,18 +17,18 @@ With the CDC module, you can: ## Quickstart -### Step 1: Import the Required Modules +### Step 1: Import Required Modules Add the following imports to your Ballerina program: - `ballerinax/cdc`: Core module that provides APIs to capture and process database change events. -- `ballerinax/mysql.cdc.driver as _`: Debezium-based driver for MySQL CDC. Use the appropriate driver for your database (e.g., `mssql.cdc.driver`, `postgresql.cdc.driver`, or `oracledb.cdc.driver`). - `ballerinax/mysql`: Provides MySQL-specific listener and types for CDC. Replace with the corresponding module for your database if needed. +- `ballerinax/mysql.cdc.driver as _`: Debezium-based driver for MySQL CDC. Use the appropriate driver for your database (e.g., `mssql.cdc.driver`, `postgresql.cdc.driver`, or `oracledb.cdc.driver`). ```ballerina import ballerinax/cdc; -import ballerinax/mysql.cdc.driver as _; import ballerinax/mysql; +import ballerinax/mysql.cdc.driver as _; ``` ### Step 2: Configure the CDC Listener diff --git a/ballerina/README.md b/ballerina/README.md index 0f2f37a..a303781 100644 --- a/ballerina/README.md +++ b/ballerina/README.md @@ -9,18 +9,18 @@ With the CDC module, you can: ## Quickstart -### Step 1: Import the Required Modules +### Step 1: Import Required Modules Add the following imports to your Ballerina program: - `ballerinax/cdc`: Core module that provides APIs to capture and process database change events. -- `ballerinax/mysql.cdc.driver as _`: Debezium-based driver for MySQL CDC. Use the appropriate driver for your database (e.g., `mssql.cdc.driver`, `postgresql.cdc.driver`, or `oracledb.cdc.driver`). - `ballerinax/mysql`: Provides MySQL-specific listener and types for CDC. Replace with the corresponding module for your database if needed. +- `ballerinax/mysql.cdc.driver as _`: Debezium-based driver for MySQL CDC. Use the appropriate driver for your database (e.g., `mssql.cdc.driver`, `postgresql.cdc.driver`, or `oracledb.cdc.driver`). ```ballerina import ballerinax/cdc; -import ballerinax/mysql.cdc.driver as _; import ballerinax/mysql; +import ballerinax/mysql.cdc.driver as _; ``` ### Step 2: Configure the CDC Listener diff --git a/ballerina/extern_functions.bal b/ballerina/extern_functions.bal index 2b652d7..6312f56 100644 --- a/ballerina/extern_functions.bal +++ b/ballerina/extern_functions.bal @@ -16,7 +16,7 @@ import ballerina/jballerina.java; -# Attach point to call the native attach method of the CDC listener. +# Attach point to call the native CDC listener attach method. # # + cdcListener - the cdc listener object # + cdcService - the cdc service object @@ -26,7 +26,7 @@ public isolated function externAttach(Listener cdcListener, Service cdcService) 'class: "io.ballerina.lib.cdc.Listener" } external; -# Attach point to call the detach start method of the CDC listener. +# Attach point to call the native CDC listener detach method. # # + cdcListener - the cdc listener object # + cdcService - the configuration map @@ -36,7 +36,7 @@ public isolated function externDetach(Listener cdcListener, Service cdcService) 'class: "io.ballerina.lib.cdc.Listener" } external; -# Attach point to call the start method of the CDC listener. +# Attach point to call the native CDC listener start method. # # + cdcListener - the cdc listener object # + config - the configuration map containing debezium properties @@ -46,7 +46,7 @@ public isolated function externStart(Listener cdcListener, map config) r 'class: "io.ballerina.lib.cdc.Listener" } external; -# Attach point to call the gracefulStop method of the CDC listener. +# Attach point to call the native CDC listener gracefulStop method. # # + cdcListener - the cdc listener object # + return - an error if the listener cannot be stopped, or `()` if successful @@ -55,7 +55,7 @@ public isolated function externGracefulStop(Listener cdcListener) returns Error? 'class: "io.ballerina.lib.cdc.Listener" } external; -# Attach point to call the immediateStop method of the CDC listener. +# Attach point to call the native CDC listener immediateStop method. # # + cdcListener - the cdc listener object # + return - an error if the listener cannot be stopped, or `()` if successful diff --git a/ballerina/service.bal b/ballerina/service.bal index 5ebaf82..a63a687 100644 --- a/ballerina/service.bal +++ b/ballerina/service.bal @@ -22,7 +22,12 @@ # # Example: # ```ballerina -# service cdcService on new cdc:MySqlListener() { +# service cdc:Service on new mysql:CdcListener() { +# +# remote function onRead(record{} after) returns error? { +# // Handle the create event +# } +# # remote function onCreate(record{} after) returns error? { # // Handle the create event # } @@ -30,6 +35,10 @@ # remote function onUpdate(record{} before, record{} after) returns error? { # // Handle the update event # } +# +# remote function onDelete(record{} before) returns error? { +# // Handle the update event +# } # } # ``` public type Service distinct service object { diff --git a/ballerina/types.bal b/ballerina/types.bal index d8f1610..43d8d4e 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -69,26 +69,6 @@ public enum DecimalHandlingMode { STRING = "string" } -# Represents the PostgreSQL logical decoding plugins. -# -# + PGOUTPUT - The standard logical decoding output plug-in in PostgreSQL 10+ -# + DECODERBUFS - A logical decoding plugin based on Protobuf and maintained by the Debezium community -public enum PostgreSQLLogicalDecodingPlugin { - PGOUTPUT = "pgoutput", - DECODERBUFS = "decoderbufs" -} - -# The adapter implementation that the connector uses when it streams database changes. -# -# + LOGMINER - The native Oracle LogMiner adapter -# + OPENLOGREPLICATOR - The OpenLogReplicator adapter -# + XSTREAM - The Oracle XStream API -public enum OracleConnectionAdopter { - LOGMINER = "logminer", - OPENLOGREPLICATOR = "olr", - XSTREAM = "xstream" -} - # Represents a secure database connection configuration. # # + sslMode - The SSL mode to use for the connection