-
Notifications
You must be signed in to change notification settings - Fork 64
Throw a more helpful error message for unsupported types #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/SqlAsyncCollector.cs
Outdated
| { | ||
| foreach (string unsupportedType in UnsupportedTypes) | ||
| { | ||
| if (columns[property].StartsWith(unsupportedType, StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to use StartsWith instead of comparing the whole string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The column type also includes the size, for example text(10).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, the value I got while testing was text() so I thought there can be sizes. Maybe the column type returned will always be text(), ntext(), and image(). I'll double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The (*) gets added on because of this line in the query
| when CHARACTER_MAXIMUM_LENGTH <> -1 then '(' + cast(CHARACTER_MAXIMUM_LENGTH as varchar(4)) + ')' |
(*) and simplified the check.
Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
* throw custom error for unsupported types * add ntext & image to test + cleanup * fix powershell ordering * Update src/SqlAsyncCollector.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * update column names * fix tests * simplify --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

Fixes: #270