Skip to content

feat: add opt-in ASCII varchar string policy - #201

Merged
mag1cfrog merged 3 commits into
mainfrom
feat/ascii-varchar-policy
Aug 5, 2026
Merged

feat: add opt-in ASCII varchar string policy#201
mag1cfrog merged 3 commits into
mainfrom
feat/ascii-varchar-policy

Conversation

@mag1cfrog

Copy link
Copy Markdown
Owner

Summary

  • Add an opt-in StringPolicy::AsciiVarChar(n) mapping for Arrow string columns.
  • Emit bounded SQL Server varchar(n) schemas and single-byte TDS payloads.
  • Reject invalid widths, non-ASCII values, and oversized values before sending any rows.
  • Support baseline token-row, direct framed bulk, and direct raw bulk writers.
  • Add documentation, diagnostics, observability, and SQL Server integration coverage.

Why

The existing Unicode-safe default maps strings to nvarchar(max). Applications whose string data is guaranteed to be ASCII can use a bounded varchar(n) representation to reduce wire and database costs without silently losing data. The new policy is explicit so existing callers keep their current Unicode behavior.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo xtask sqlserver-test

@mag1cfrog
mag1cfrog marked this pull request as ready for review August 5, 2026 01:24
@mag1cfrog
mag1cfrog merged commit 37e4b07 into main Aug 5, 2026
6 checks passed
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