Skip to content

Conversation

@imedyaosandi
Copy link
Contributor

@imedyaosandi imedyaosandi commented Nov 25, 2025

$Subject

db-connector-reduced.mov

Summary by CodeRabbit

  • Documentation
    • Added a DB Connector overview page describing capabilities and compatibility.
    • Added a comprehensive DB Connector reference documenting connection pooling, configuration parameters, operations (select, insert, delete, executeQuery, callProcedure) and transaction management with isolation-level examples.
    • Added a hands-on Order Management example demonstrating transactional flows, error handling, sample schemas, requests/responses, and deployment/testing guidance.
    • Updated site navigation to include the new DB Connector docs.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Nov 25, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

Adds three new DB Connector documentation pages (overview, configuration reference, example) and updates site navigation to include the DB Connector section; documents connection/config parameters, supported operations, transaction examples, and a complete Order Management example with schema and sample requests.

Changes

Cohort / File(s) Summary
DB Connector docs
en/docs/reference/connectors/db-connector/db-connector-overview.md, en/docs/reference/connectors/db-connector/db-connector-config.md, en/docs/reference/connectors/db-connector/db-connector-example.md
Adds overview, detailed configuration reference (connection pooling, core/additional parameters, MySQL/Postgres examples), operation docs (select, insert, delete, callProcedure, executeQuery, transactions with isolation levels), result handling, and a transactional Order Management example with schema, XML source view, sample requests/responses, and a downloadable project.
Site navigation
en/mkdocs.yml
Inserts a "DB Connector" section in the documentation navigation linking the three new pages.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant API
  participant DBConnector
  participant Database

  Client->>API: GET /place_order?customerId&productId&quantity
  API->>DBConnector: beginTransaction()
  DBConnector->>Database: BEGIN TRANSACTION
  API->>DBConnector: select (check stock)
  DBConnector->>Database: SELECT ... FOR UPDATE
  Database-->>DBConnector: stock result
  DBConnector-->>API: stock info
  alt stock sufficient
    API->>DBConnector: insert Order
    DBConnector->>Database: INSERT INTO Orders ...
    API->>DBConnector: insert OrderItems
    DBConnector->>Database: INSERT INTO OrderItems ...
    API->>DBConnector: executeQuery (update product stock)
    DBConnector->>Database: UPDATE Products ...
    API->>DBConnector: commitTransaction()
    DBConnector->>Database: COMMIT
    DBConnector-->>API: success
    API-->>Client: 200 OK (order placed)
  else insufficient stock
    API->>DBConnector: rollbackTransaction()
    DBConnector->>Database: ROLLBACK
    DBConnector-->>API: error
    API-->>Client: 4xx (out of stock)
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Focus review on documentation clarity, correctness of SQL examples and transactional XML snippets.
  • Verify mkdocs navigation placement and link paths.
  • Check sample project archive and curl examples for accuracy.

Suggested reviewers

  • chanikag
  • arunans23

Poem

🐰 I hopped through docs with a cheerful ping,
Configs and examples tied to a string,
Transactions lined up, SQL in a row,
Orders march onward — commit or no! 🚩

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and largely off-topic. It contains only '$Subject' as a placeholder and a link to an asset, missing all required template sections such as Purpose, Goals, Approach, User stories, Release notes, and others. Fill in all required sections from the template: Purpose (with issue links), Goals, Approach, User stories, Release notes, Documentation links, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Database Connector Docs' is clear and specific, accurately summarizing the main change of adding comprehensive DB Connector documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (3)
en/docs/reference/connectors/db-connector/db-connector-overview.md (2)

36-36: Use hyphen for compound adjective "open-source."

When "open source" precedes a noun, it should be hyphenated. Apply this diff:

-As an open source project, WSO2 extensions welcome contributions from the community.
+As an open-source project, WSO2 extensions welcome contributions from the community.

28-32: Reduce repetition by varying sentence structure.

The first two bullets both begin with "DB Connector," creating a repetitive opening. Consider rewording one bullet to improve readability.

-* **[DB Connector Example]({{base_path}}/reference/connectors/db-connector/db-connector-example/)**: This example explains how to use the DB Connector to build a simple Order Management API, demonstrating query execution, data modification, and transaction management.
+* **[DB Connector Example]({{base_path}}/reference/connectors/db-connector/db-connector-example/)**: Learn how to build a simple Order Management API using this connector, demonstrating query execution, data modification, and transaction management.
en/docs/reference/connectors/db-connector/db-connector-example.md (1)

112-122: Reduce repetition in step instructions.

Lines 112, 116, and 120 each begin with "Add," creating a repetitive pattern. Vary the sentence structure:

 2. Add Select operation as below.
    <img src="{{base_path}}/assets/img/integrate/connectors/db/select-operation.png" title="Select Operation" width="800" alt="Select Operation"/>
 
-3. Add filter to check the stock availability.
+3. Filter for stock availability using a Filter mediator.
    <img src="{{base_path}}/assets/img/integrate/connectors/db/filter.png" title="Filter" width="800" alt="Filter"/>
 
-4. Add Insert operation to the then flow.
+4. In the then flow, add an Insert operation.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fd7004 and e22b8cb.

⛔ Files ignored due to path filters (12)
  • en/docs/assets/img/integrate/connectors/db-store.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/add-connection-details.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/add-connector.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/add-mysql-connection.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/add-query-param.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/begintransaction-operation.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/complete-flow.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/connector-operations.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/execute-query-operation.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/filter.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/insert-operation.png is excluded by !**/*.png
  • en/docs/assets/img/integrate/connectors/db/select-operation.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • en/docs/reference/connectors/db-connector/db-connector-config.md (1 hunks)
  • en/docs/reference/connectors/db-connector/db-connector-example.md (1 hunks)
  • en/docs/reference/connectors/db-connector/db-connector-overview.md (1 hunks)
  • en/mkdocs.yml (1 hunks)
🧰 Additional context used
🪛 LanguageTool
en/docs/reference/connectors/db-connector/db-connector-overview.md

[style] ~32-~32: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tion, and transaction management. * **[DB Connector Reference]({{base_path}}/refe...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[grammar] ~36-~36: Use a hyphen to join words.
Context: ...tions. ## How to contribute As an open source project, WSO2 extensions welcome ...

(QB_NEW_EN_HYPHEN)

en/docs/reference/connectors/db-connector/db-connector-example.md

[grammar] ~98-~98: Ensure spelling is correct
Context: ...ect "Select Local Driver" or "Add Maven Dependancy" options. For this example let's use the...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...idth="800" alt="Select Operation"/> 3. Add filter to check the stock availability....

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~120-~120: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ..."Filter" width="800" alt="Filter"/> 4. Add Insert operation to the then flow. ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (3)
en/mkdocs.yml (1)

823-826: Navigation structure is correct and consistent.

The DB Connector section is properly placed alphabetically after Microsoft Azure Storage and before MongoDB Connector, with all three documentation files correctly referenced. YAML indentation is consistent with surrounding connector entries.

en/docs/reference/connectors/db-connector/db-connector-config.md (1)

175-180: Verify isResultSet setting for UPDATE query in executeQuery operation.

Line 180 sets <isResultSet>true</isResultSet> for an UPDATE query. UPDATE statements typically do not return result sets—they return an update count. Consider whether this should be false:

<db.executeQuery configKey="DBCon1">
    <query>UPDATE `products` SET `stock_quantity` = `stock_quantity` - ? WHERE product_id = ?</query>
    ...
    <isResultSet>true</isResultSet>  <!-- Should this be false for UPDATE? -->
en/docs/reference/connectors/db-connector/db-connector-example.md (1)

175-180: Verify isResultSet configuration for UPDATE statement.

In the XML source (lines 175–187), the executeQuery operation contains an UPDATE statement but sets <isResultSet>true</isResultSet> on line 180. UPDATE queries typically do not return result sets. Please verify whether this should be false.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
en/docs/reference/connectors/db-connector/db-connector-example.md (1)

112-124: Reduce repetitive sentence starters for better readability.

Lines 112, 116, and 120 begin successive steps with "Add," creating a repetitive rhythm. Varying the phrasing will improve clarity and flow.

Consider rephrasing as follows:

- 2. Add Select operation as below.
+ 2. Configure a Select operation as below.

- 3. Add filter to check the stock availability.
+ 3. Insert a filter to check the stock availability.

- 4. Add Insert operation to the then flow.
+ 4. Configure the Insert operation in the then flow.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e22b8cb and 13ac06b.

📒 Files selected for processing (2)
  • en/docs/reference/connectors/db-connector/db-connector-config.md (1 hunks)
  • en/docs/reference/connectors/db-connector/db-connector-example.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • en/docs/reference/connectors/db-connector/db-connector-config.md
🧰 Additional context used
🪛 LanguageTool
en/docs/reference/connectors/db-connector/db-connector-example.md

[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...idth="800" alt="Select Operation"/> 3. Add filter to check the stock availability....

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~120-~120: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ..."Filter" width="800" alt="Filter"/> 4. Add Insert operation to the then flow. ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (1)
en/docs/reference/connectors/db-connector/db-connector-example.md (1)

249-250: Clarify OrderItems table expectations.

Line 249 mentions checking the Orders and OrderItems tables, but the XML configuration (line 164) only inserts into the Orders table. The example doesn't explicitly create OrderItems records. Please clarify whether:

  • The example intentionally focuses only on Orders, or
  • The XML should include an additional insert into OrderItems (and the documentation should reflect that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants