Added :text format test case and updated test project to have all supported frameworks#30
Open
terryaney wants to merge 2 commits intoDrizin:mainfrom
Open
Added :text format test case and updated test project to have all supported frameworks#30terryaney wants to merge 2 commits intoDrizin:mainfrom
terryaney wants to merge 2 commits intoDrizin:mainfrom
Conversation
…ported frameworks
The problem only presents itself when using XElement:text format in MS SQL Server because there is a Xml type. In unit tests or other databases (i.e. SQLLite) that don't have a Xml type, the XElement is converted to string automatically without issue. Root Transformation Problem: XElement implements IEnumerable<XNode>, so when checking argumentValue is IEnumerable<object> at ~InterpolatedSqlParser.cs:250, XElements were being treated as collections instead of single values that need string conversion. In addition to that fix, another problem was NET6+ handler goes directly to AppendArgument, bypassing ProcessArgument where TransformArgument is called. The fix: Make AppendArgument call TransformArgument so both paths (FormattableString and InterpolatedStringHandler) get the full transformation logic, which means: 1. NET6+ InterpolatedStringHandler → AppendArgument → TransformArgument 2. Legacy FormattableString → Parser.ParseInsert → ProcessArgument → TransformArgument
Contributor
Author
|
See my new commit comment...it explains what I found/did/why. Note: I had copilot help me, but reviewing the fix, it seems valid but you'd probably know better than me/AI. I tried to run tests (I had to download/install AdventureWorks db) and I had some errors, but digging...
|
Contributor
Author
|
InterpolatedSql.ToStringRepro.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.