Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- main
- 2201.[0-9]+.x
repository_dispatch:
types: check_connector_for_breaking_changes
workflow_dispatch:

jobs:
call_workflow:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
with:
repo-name: module-ballerinax-cdc
additional-build-flags: -x :cdc-examples:build

additional-test-flags: -x :cdc-compiler-plugin-tests:test
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

additional-ubuntu-build-flags: -x :cdc-examples:build
additional-windows-test-flags: -x test
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ballerina/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions ballerina/extern_functions.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -46,7 +46,7 @@ public isolated function externStart(Listener cdcListener, map<string> 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
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion ballerina/service.bal
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@
#
# 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
# }
#
# 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 {
Expand Down
20 changes: 0 additions & 20 deletions ballerina/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down