Skip to content

fix: treat empty boolean and number connection string values as not set - #1961

Merged
dhensby merged 1 commit into
tediousjs:masterfrom
dhensby:claude/empty-connection-string-values
Nov 19, 2026
Merged

dhensby merged 1 commit into
tediousjs:masterfrom
dhensby:claude/empty-connection-string-values

Conversation

@dhensby

@dhensby dhensby commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

What this does:

An empty boolean or number value in a connection string, for example UseUTC= or Packet Size=, gave a different result from a left-out key. #1960 fixed this for Encrypt only. This change fixes it for every boolean and number key.

Connection string Before After (same as left out)
UseUTC= useUTC: false tedious default true
Packet Size= 8000 tedious default 4096
ConnectRetryInterval= 10000 ms tedious default 500 ms
Max Pool Size= 100 node-mssql default 10
Request Timeout= NaN, which msnodesqlv8 used as its query timeout 15000

@tediousjs/connection-string gives the schema default for an empty boolean or number value. node-mssql now drops the defaults from its schema, so an empty value gives undefined, and the parser skips it. This replaces the encrypt-only handling from #1960. Values that are not empty do not change. Connection Timeout=, Min Pool Size=, Stream=, ParseJSON=, MultiSubnetFailover= and TrustServerCertificate= already gave the default value, so their result does not change.

The new unit tests check that each boolean and number key gives the same config when it is empty, only whitespace or left out. They also add tests for explicit number values. The empty-value tests fail before the fix and pass after it. Lint and all 317 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

An empty boolean or number value, for example `UseUTC=` or
`Packet Size=`, gave a different result from a left-out key:

- `UseUTC=` set `useUTC: false`, but tedious defaults to true.
- `Packet Size=` set 8000, but tedious defaults to 4096.
- `ConnectRetryInterval=` set 10000 ms, but tedious defaults to 500 ms.
- `Max Pool Size=` set 100, but node-mssql defaults to 10.
- `Request Timeout=` set NaN, which msnodesqlv8 used as its query
  timeout.

@tediousjs/connection-string gives the schema default for an empty
value. node-mssql now drops the defaults from its schema, so an empty
value gives undefined, and the parser skips it. This replaces the
encrypt-only handling. Values that are not empty do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhensby
dhensby marked this pull request as ready for review November 18, 2026 23:32
@dhensby
dhensby merged commit 61174bf into tediousjs:master Nov 19, 2026
47 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 12.7.16 🎉

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