Skip to content

fix: mssql readonly connections#41668

Draft
sebastianiv21 wants to merge 4 commits intoreleasefrom
fix/mssql-readonly-connections
Draft

fix: mssql readonly connections#41668
sebastianiv21 wants to merge 4 commits intoreleasefrom
fix/mssql-readonly-connections

Conversation

@sebastianiv21
Copy link
Copy Markdown
Contributor

@sebastianiv21 sebastianiv21 commented Mar 28, 2026

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

This PR wires up the MSSQL datasource’s Read-only connection mode end to end. When the datasource is set to read-only, the plugin adds ApplicationIntent=ReadOnly to the JDBC URL (so SQL Server can send the session to a readable secondary in Always On Availability Groups) and sets Hikari’s pool to read-only. Read/write mode is unchanged and does not add that parameter.

A short tooltip on the connection mode control explains that read-only uses ApplicationIntent=ReadOnly and that it mainly matters for Always On setups. New unit tests check that the built JDBC URL includes ApplicationIntent=ReadOnly for read-only mode and omits ApplicationIntent for read/write.

Fixes #Issue Number
or
Fixes https://github.com/appsmithorg/appsmith-ee/issues/8615

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Warning

Tests have not run on the HEAD c3d6070 yet


Sat, 28 Mar 2026 01:33:39 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

- Implemented connection mode configuration for READ_ONLY, appending "ApplicationIntent=ReadOnly" to the JDBC URL and setting the HikariCP configuration to read-only.
- Updated form.json to include a tooltip explaining the implications of using read-only mode.
- Added unit tests to verify the correct behavior of both READ_ONLY and READ_WRITE connection modes, ensuring the JDBC URL is constructed appropriately based on the selected mode.
- Simplified the connection mode check by using a local variable for the connection configuration.
- Updated unit tests to utilize the new import for READ_ONLY and READ_WRITE modes, ensuring clarity and consistency in the test cases.
- Enhanced readability of the code by reducing redundancy in connection mode checks.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e20037bb-066f-4806-ad76-1b68cb7e57db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mssql-readonly-connections

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.

@github-actions github-actions bot added the Bug Something isn't working label Mar 28, 2026
@sebastianiv21
Copy link
Copy Markdown
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/23674174200.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41668.
recreate: .
base-image-tag: .

@github-actions
Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-41668.dp.appsmith.com

@github-actions
Copy link
Copy Markdown

Failed server tests

  • com.external.plugins.FirestorePluginTest#
  • com.external.plugins.RedshiftPluginTest#
  • com.external.plugins.AmazonS3PluginTest#
  • com.external.utils.AmazonS3ErrorUtilsTest#
  • com.external.config.RowsUpdateMethodTest#
  • com.external.config.GetDatasourceMetadataMethodTest#
  • com.external.config.FileListMethodTest#
  • com.external.config.FileInfoMethodTest#
  • com.external.config.MethodConfigTest#
  • com.external.config.SheetsUtilTest#
  • com.external.config.RowsGetMethodTest#
  • com.external.config.RowsAppendMethodTest#
  • com.external.config.GetStructureMethodTest#
  • com.external.config.RowsBulkUpdateMethodTest#
  • com.external.config.RowsBulkAppendMethodTest#
  • com.external.plugins.GraphQLPluginTest#
  • com.external.plugins.SnowflakePluginTest#
  • com.external.plugins.SmtpPluginTest#
  • com.external.plugins.OpenAIPluginTest#
  • com.external.plugins.VisionCommandTest#
  • com.external.plugins.EmbeddingCommandTest#
  • com.external.plugins.ChatCommandTest#
  • com.external.plugins.AnthropicPluginTest#
  • com.external.plugins.GoogleAiPluginTest#
  • com.external.plugins.GenerateContentCommandTest#
  • com.external.plugins.services.AiFeatureServiceFactoryTest#
  • com.external.plugins.services.FieldValidationHelperTest#
  • com.external.plugins.services.FileUtilTest#
  • com.external.plugins.services.HeadersUtilTest#
  • com.external.plugins.services.features.ImageClassificationServiceImplTest#
  • com.external.plugins.services.features.TextGenerationServiceImplTest#
  • com.external.plugins.services.features.TextSummarizationServiceImplTest#
  • com.external.plugins.services.features.ImageCaptioningServiceImplTest#
  • com.external.plugins.services.features.TextEntityExtractionServiceImplTest#
  • com.external.plugins.services.features.TextClassificationServiceImplTest#
  • com.external.plugins.services.features.ImageEntityExtractionServiceImplTest#
  • com.external.plugins.AwsLambdaPluginTest#
  • com.external.plugins.DatabricksPluginTest#
  • GsonUnorderedToOrderedSerializationTest#
  • com.appsmith.git.service.BashServiceTest#
  • com.appsmith.git.converters.GsonDoubleToLongConverterTest#
  • com.appsmith.git.helpers.FileUtilsImplTest#
  • com.appsmith.git.helpers.DSLTransformerHelperTest#
  • com.external.plugins.MssqlPluginTest#testReadOnlyConnectionMode
  • com.external.plugins.MssqlPluginTest#testReadWriteConnectionMode

1 similar comment
@github-actions
Copy link
Copy Markdown

Failed server tests

  • com.external.plugins.FirestorePluginTest#
  • com.external.plugins.RedshiftPluginTest#
  • com.external.plugins.AmazonS3PluginTest#
  • com.external.utils.AmazonS3ErrorUtilsTest#
  • com.external.config.RowsUpdateMethodTest#
  • com.external.config.GetDatasourceMetadataMethodTest#
  • com.external.config.FileListMethodTest#
  • com.external.config.FileInfoMethodTest#
  • com.external.config.MethodConfigTest#
  • com.external.config.SheetsUtilTest#
  • com.external.config.RowsGetMethodTest#
  • com.external.config.RowsAppendMethodTest#
  • com.external.config.GetStructureMethodTest#
  • com.external.config.RowsBulkUpdateMethodTest#
  • com.external.config.RowsBulkAppendMethodTest#
  • com.external.plugins.GraphQLPluginTest#
  • com.external.plugins.SnowflakePluginTest#
  • com.external.plugins.SmtpPluginTest#
  • com.external.plugins.OpenAIPluginTest#
  • com.external.plugins.VisionCommandTest#
  • com.external.plugins.EmbeddingCommandTest#
  • com.external.plugins.ChatCommandTest#
  • com.external.plugins.AnthropicPluginTest#
  • com.external.plugins.GoogleAiPluginTest#
  • com.external.plugins.GenerateContentCommandTest#
  • com.external.plugins.services.AiFeatureServiceFactoryTest#
  • com.external.plugins.services.FieldValidationHelperTest#
  • com.external.plugins.services.FileUtilTest#
  • com.external.plugins.services.HeadersUtilTest#
  • com.external.plugins.services.features.ImageClassificationServiceImplTest#
  • com.external.plugins.services.features.TextGenerationServiceImplTest#
  • com.external.plugins.services.features.TextSummarizationServiceImplTest#
  • com.external.plugins.services.features.ImageCaptioningServiceImplTest#
  • com.external.plugins.services.features.TextEntityExtractionServiceImplTest#
  • com.external.plugins.services.features.TextClassificationServiceImplTest#
  • com.external.plugins.services.features.ImageEntityExtractionServiceImplTest#
  • com.external.plugins.AwsLambdaPluginTest#
  • com.external.plugins.DatabricksPluginTest#
  • GsonUnorderedToOrderedSerializationTest#
  • com.appsmith.git.service.BashServiceTest#
  • com.appsmith.git.converters.GsonDoubleToLongConverterTest#
  • com.appsmith.git.helpers.FileUtilsImplTest#
  • com.appsmith.git.helpers.DSLTransformerHelperTest#
  • com.external.plugins.MssqlPluginTest#testReadOnlyConnectionMode
  • com.external.plugins.MssqlPluginTest#testReadWriteConnectionMode

Updated the tooltip text for the READ_ONLY connection mode to provide clearer information on its behavior with Always On Availability Groups, emphasizing the potential for write access in certain configurations and the importance of using database roles for strict enforcement.
@sebastianiv21
Copy link
Copy Markdown
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/23674513288.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41668.
recreate: .
base-image-tag: .

@github-actions
Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-41668.dp.appsmith.com

@github-actions
Copy link
Copy Markdown

Failed server tests

  • com.external.plugins.FirestorePluginTest#
  • com.external.plugins.RedshiftPluginTest#
  • com.external.plugins.AmazonS3PluginTest#
  • com.external.utils.AmazonS3ErrorUtilsTest#
  • com.external.config.RowsUpdateMethodTest#
  • com.external.config.GetDatasourceMetadataMethodTest#
  • com.external.config.FileListMethodTest#
  • com.external.config.FileInfoMethodTest#
  • com.external.config.MethodConfigTest#
  • com.external.config.SheetsUtilTest#
  • com.external.config.RowsGetMethodTest#
  • com.external.config.RowsAppendMethodTest#
  • com.external.config.GetStructureMethodTest#
  • com.external.config.RowsBulkUpdateMethodTest#
  • com.external.config.RowsBulkAppendMethodTest#
  • com.external.plugins.GraphQLPluginTest#
  • com.external.plugins.SnowflakePluginTest#
  • com.external.plugins.SmtpPluginTest#
  • com.external.plugins.OpenAIPluginTest#
  • com.external.plugins.VisionCommandTest#
  • com.external.plugins.EmbeddingCommandTest#
  • com.external.plugins.ChatCommandTest#
  • com.external.plugins.AnthropicPluginTest#
  • com.external.plugins.GoogleAiPluginTest#
  • com.external.plugins.GenerateContentCommandTest#
  • com.external.plugins.services.AiFeatureServiceFactoryTest#
  • com.external.plugins.services.FieldValidationHelperTest#
  • com.external.plugins.services.FileUtilTest#
  • com.external.plugins.services.HeadersUtilTest#
  • com.external.plugins.services.features.ImageClassificationServiceImplTest#
  • com.external.plugins.services.features.TextGenerationServiceImplTest#
  • com.external.plugins.services.features.TextSummarizationServiceImplTest#
  • com.external.plugins.services.features.ImageCaptioningServiceImplTest#
  • com.external.plugins.services.features.TextEntityExtractionServiceImplTest#
  • com.external.plugins.services.features.TextClassificationServiceImplTest#
  • com.external.plugins.services.features.ImageEntityExtractionServiceImplTest#
  • com.external.plugins.AwsLambdaPluginTest#
  • com.external.plugins.DatabricksPluginTest#
  • GsonUnorderedToOrderedSerializationTest#
  • com.appsmith.git.service.BashServiceTest#
  • com.appsmith.git.converters.GsonDoubleToLongConverterTest#
  • com.appsmith.git.helpers.FileUtilsImplTest#
  • com.appsmith.git.helpers.DSLTransformerHelperTest#
  • com.external.plugins.MssqlPluginTest#testReadOnlyConnectionMode
  • com.external.plugins.MssqlPluginTest#testReadWriteConnectionMode

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

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant