Skip to content

Preserve connection string values containing equals signs#177

Merged
msallin merged 1 commit into
masterfrom
fix/connection-string-value-with-equals
Jun 16, 2026
Merged

Preserve connection string values containing equals signs#177
msallin merged 1 commit into
masterfrom
fix/connection-string-value-with-equals

Conversation

@msallin

@msallin msallin commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

ConnectionStringParser.ParseConnectionString split each key=value pair on every = and kept only keyValue[1]. A Data Source whose value contains = (a file path, or a FullUri with query parameters) was truncated at the first =. A repeated key also threw because the dictionary was populated with Add.

Changes

  • Split each pair on the first = only (Split(separator, 2, StringSplitOptions.None)), preserving the rest of the value. Available on net40/net45/netstandard2.1.
  • Populate the dictionary via the indexer (last value wins) instead of Add, so a repeated key does not throw.

Tests

Added ConnectionStringParserTest cases for a Data Source value containing = and for a repeated key. Full suite green (49 tests).

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 198ca2cb-b0ce-4c3f-b6db-5e30e571848c

📥 Commits

Reviewing files that changed from the base of the PR and between 814b6f7 and 54060b4.

📒 Files selected for processing (2)
  • SQLite.CodeFirst.Test/UnitTests/Utility/ConnectionStringParserTest.cs
  • SQLite.CodeFirst/Internal/Utility/ConnectionStringParser.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • SQLite.CodeFirst/Internal/Utility/ConnectionStringParser.cs
  • SQLite.CodeFirst.Test/UnitTests/Utility/ConnectionStringParserTest.cs

📝 Walkthrough

Walkthrough

ConnectionStringParser.ParseConnectionString is updated to split each key/value pair on the first = only, preserving = characters inside values, and to use indexer assignment instead of Dictionary.Add so duplicate keys follow last-value-wins semantics. Two new unit tests cover these two behaviors.

Changes

Connection string parser fix and tests

Layer / File(s) Summary
Split on first = and last-wins duplicate key
SQLite.CodeFirst/Internal/Utility/ConnectionStringParser.cs, SQLite.CodeFirst.Test/UnitTests/Utility/ConnectionStringParserTest.cs
ParseConnectionString splits pairs on the first = only so values containing = are not truncated, and replaces Dictionary.Add with indexer assignment so repeated data source keys retain the last occurrence. Two new [TestMethod] cases assert each behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny once tripped on an equals sign,
The parser split wrong — what a terrible time!
Now split on the first =, the rest rides along,
And last key wins when duplicates throng.
🐇✨ The path is now parsed without a mishap!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: preserving connection string values that contain equals signs by changing the splitting logic.
Description check ✅ Passed The description clearly explains the bug, the changes made, and provides test coverage details, directly relating to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/connection-string-value-with-equals

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

ParseConnectionString split each pair on every '=' and kept only the second
segment, truncating any Data Source value that contains '=' at the first one.
Split on the first '=' only. Also assign via the dictionary indexer (last value
wins) instead of Add, so a repeated key no longer throws.
@msallin msallin force-pushed the fix/connection-string-value-with-equals branch from 814b6f7 to 54060b4 Compare June 16, 2026 04:23
@sonarqubecloud

Copy link
Copy Markdown

@msallin msallin merged commit c6cae41 into master Jun 16, 2026
4 checks passed
@msallin msallin deleted the fix/connection-string-value-with-equals branch June 16, 2026 04:25
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.

1 participant