Skip to content

fix: parse the connection string ApplicationIntent value without case - #1966

Merged
dhensby merged 1 commit into
tediousjs:masterfrom
dhensby:claude/determined-diffie-e0a7ce
Nov 20, 2026
Merged

dhensby merged 1 commit into
tediousjs:masterfrom
dhensby:claude/determined-diffie-e0a7ce

Conversation

@dhensby

@dhensby dhensby commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

What this does:

The connection string parser set readOnlyIntent only when the ApplicationIntent value was the all-lowercase readonly. ApplicationIntent=ReadOnly, the casing in the Microsoft docs, gave a read-write connection with no error.

The parser now trims the value and compares it without case.

Connection string Before After
ApplicationIntent=ReadOnly readOnlyIntent: false readOnlyIntent: true
ApplicationIntent=READONLY readOnlyIntent: false readOnlyIntent: true
ApplicationIntent={ ReadOnly } readOnlyIntent: false readOnlyIntent: true
ApplicationIntent=readonly readOnlyIntent: true readOnlyIntent: true
ApplicationIntent=ReadWrite readOnlyIntent: false readOnlyIntent: false
ApplicationIntent= or ApplicationIntent={ } readOnlyIntent: false not set, the same as a left-out key

@tediousjs/connection-string trims unquoted values but keeps the spaces in a braced value, so node-mssql trims the value itself. An empty value now gives the same config as a left-out key, which matches the empty-value handling from #1960 and #1961. Other values still give readOnlyIntent: false.

The new unit tests cover each row above and the tedious _config() output. The case, whitespace and empty-value tests fail before the fix and pass after it. Lint and all 378 unit tests pass. No live SQL Server integration tests were run.

Related issues:

Pre/Post merge checklist:

  • Changelog is maintained through release notes, per CHANGELOG.txt.

🤖 Generated with Claude Code

The parser set readOnlyIntent only for the all-lowercase value
"readonly". ApplicationIntent=ReadOnly, the casing in the Microsoft
docs, gave a read-write connection.

Compare the trimmed value without case. An empty value now gives the
same config as a left-out key, so the driver default applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhensby
dhensby marked this pull request as ready for review November 20, 2026 09:05
@dhensby
dhensby merged commit a2e39e0 into tediousjs:master Nov 20, 2026
91 of 94 checks passed
@dhensby
dhensby deleted the claude/determined-diffie-e0a7ce branch November 20, 2026 11:17
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 12.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant