Skip to content
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

Error Handling #507

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions AzureDataStudioExtension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Change Log

## [v9.2.0](https://github.com/MarkMpn/Sql4Cds/releases/tag/v9.2.0) - 2024-07-10

Added export to CSV/Excel/JSON/Markdown/XML
Simplify filters that can easily be identified as tautologies or contradictions
Fixed incorrectly matching `null` values in hash joins
Fixed identification of nullable columns in outer joins
Handle `createdon` column being null in some system tables
Fixed use of metadata queries within loops
Fixed filtering and aggregation special cases with `audit` entity
Fixed incorrect type conversion errors when using specialized FetchXML condition operators
Fixed use of `CAST` and `CONVERT` with string types
Fixed paging when using semi-joins
Various fixes when querying virtual entities with unreliable providers:
* values returned as different types
* attributes using names with different case
* not honouring `top`, `offset`, `count`, `order`
Improved error reporting:
* when using `*` instead of column name
* when passing incorrect number of parameters to aggregate functions
* when comparing lookup/optionset columns to invalid string values

## [v9.1.0](https://github.com/MarkMpn/Sql4Cds/releases/tag/v9.1.0) - 2024-06-10

Enabled access to recycle bin records via the `bin` schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
<Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Text.Json">
<Version>6.0.7</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MarkMpn.Sql4Cds.Engine\MarkMpn.Sql4Cds.Engine.csproj">
Expand Down
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ internal static Sql4CdsError AmbiguousColumnName(ColumnReferenceExpression colum

internal static Sql4CdsError ConversionFailed(DataTypeReference sourceType, Literal sourceValue, DataTypeReference targetType)
{
return Create(245, sourceValue, GetTypeName(sourceType), (SqlInt32)sourceValue.Value.Length, Collation.USEnglish.ToSqlString(sourceValue.Value), GetTypeName(targetType));
return Create(245, sourceValue, Collation.USEnglish.ToSqlString(GetTypeName(sourceType)), (SqlInt32)sourceValue.Value.Length, Collation.USEnglish.ToSqlString(sourceValue.Value), Collation.USEnglish.ToSqlString(GetTypeName(targetType)));
}

internal static Sql4CdsError CollationConflict(TSqlFragment fragment, Collation source, Collation target, string operationName)
Expand Down
34 changes: 19 additions & 15 deletions MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
<iconUrl>https://markcarrington.dev/sql4cds-icon/</iconUrl>
<description>Convert SQL queries to FetchXml and execute them against Dataverse / D365</description>
<summary>Convert SQL queries to FetchXml and execute them against Dataverse / D365</summary>
<releaseNotes>Enabled access to recycle bin records via the `bin` schema
Enabled `INSERT`, `UPDATE` and `DELETE` statements on `principalobjectaccess` table
Enabled use of subqueries within `ON` clause of `JOIN` statements
Added support for `___pid` virtual column for lookups to elastic tables
Improved folding of queries using index spools
Improved primary key calculation when using joins on non-key columns
Apply column order setting to parameters for stored procedures and table-valued functions
Fixed error with DeleteMultiple requests
Fixed paging error with `DISTINCT` queries causing results to be limited to 50,000 records
Fixed paging errors when sorting by optionset values causing some results to be skipped
Fixed errors when using joins inside `[NOT] EXISTS` subqueries
Fixed incorrect results when applying aliases to `___name` and `___type` virtual columns
Fixed max length calculation for string columns
Added debug visualizer to inspect query plans within Visual Studio
Fixed "invalid program" errors when combining type conversions with `AND` or `OR` in .NET Core applications
<releaseNotes>Simplify filters that can easily be identified as tautologies or contradictions
Fixed incorrectly matching `null` values in hash joins
Fixed identification of nullable columns in outer joins
Handle `createdon` column being null in some system tables
Fixed use of metadata queries within loops
Fixed filtering and aggregation special cases with `audit` entity
Fixed incorrect type conversion errors when using specialized FetchXML condition operators
Fixed use of `CAST` and `CONVERT` with string types
Fixed paging when using semi-joins
Various fixes when querying virtual entities with unreliable providers:
* values returned as different types
* attributes using names with different case
* not honouring `top`, `offset`, `count`, `order`
Improved error reporting:
* when using `*` instead of column name
* when passing incorrect number of parameters to aggregate functions
* when comparing lookup/optionset columns to invalid string values
</releaseNotes>
<copyright>Copyright © 2020 Mark Carrington</copyright>
<language>en-GB</language>
Expand All @@ -36,13 +38,15 @@ Fixed "invalid program" errors when combining type conversions with `AND` or `OR
<dependency id="Microsoft.CrmSdk.XrmTooling.CoreAssembly" version="9.1.1.32" />
<dependency id="Microsoft.SqlServer.TransactSql.ScriptDom" version="161.8834.0" />
<dependency id="Microsoft.ApplicationInsights" version="2.21.0" />
<dependency id="System.Data.SqlClient" version="4.8.6" />
<dependency id="XPath2.Extensions" version="1.1.3" />
</group>
<group targetFramework=".NETCoreApp6.0">
<dependency id="Microsoft.PowerPlatform.Dataverse.Client" version="1.1.9" />
<dependency id="Microsoft.SqlServer.TransactSql.ScriptDom" version="161.8834.0" />
<dependency id="System.Data.SqlClient" version="4.8.6" />
<dependency id="Microsoft.ApplicationInsights" version="2.21.0" />
<dependency id="System.Data.SqlClient" version="4.8.6" />
<dependency id="XPath2.Extensions" version="1.1.3" />
</group>
</dependencies>
Expand Down
50 changes: 37 additions & 13 deletions MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,29 @@ plugins or integrations by writing familiar SQL and converting it.
Queries can also run using the preview TDS Endpoint. A wide range of SQL functionality is also built
in to allow running queries that aren't directly supported by either FetchXML or the TDS Endpoint.</description>
<summary>Convert SQL queries to FetchXML and execute them against Dataverse / D365</summary>
<releaseNotes>Enabled access to recycle bin records via the `bin` schema
Enabled `INSERT`, `UPDATE` and `DELETE` statements on `principalobjectaccess` table
Enabled use of subqueries within `ON` clause of `JOIN` statements
Added support for `___pid` virtual column for lookups to elastic tables
Improved folding of queries using index spools
Improved primary key calculation when using joins on non-key columns
Apply column order setting to parameters for stored procedures and table-valued functions
Fixed error with DeleteMultiple requests
Fixed paging error with `DISTINCT` queries causing results to be limited to 50,000 records
Fixed paging errors when sorting by optionset values causing some results to be skipped
Fixed errors when using joins inside `[NOT] EXISTS` subqueries
Fixed incorrect results when applying aliases to `___name` and `___type` virtual columns
Fixed max length calculation for string columns
<releaseNotes>Added Copilot
Added "Script Table/Function/Prcedure As" menu options
Improved startup performance
Added option to change editor font and size
Added keyboard shortcuts to switch (`Ctrl+[`, `Ctrl+]`) and close (`Ctrl+W`) tabs
Added export to CSV/Excel
Simplify filters that can easily be identified as tautologies or contradictions
Fixed incorrectly matching `null` values in hash joins
Fixed identification of nullable columns in outer joins
Handle `createdon` column being null in some system tables
Fixed use of metadata queries within loops
Fixed filtering and aggregation special cases with `audit` entity
Fixed incorrect type conversion errors when using specialized FetchXML condition operators
Fixed use of `CAST` and `CONVERT` with string types
Fixed paging when using semi-joins
Various fixes when querying virtual entities with unreliable providers:
* values returned as different types
* attributes using names with different case
* not honouring `top`, `offset`, `count`, `order`
Improved error reporting:
* when using `*` instead of column name
* when passing incorrect number of parameters to aggregate functions
* when comparing lookup/optionset columns to invalid string values
</releaseNotes>
<copyright>Copyright © 2019 Mark Carrington</copyright>
<language>en-GB</language>
Expand All @@ -56,5 +66,19 @@ Fixed max length calculation for string columns
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\System.Text.Encoding.CodePages.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\System.Text.Encoding.CodePages.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\XPath2.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\XPath2.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\XPath2.Extensions.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\XPath2.Extensions.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Azure.Core.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Azure.Core.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Azure.Identity.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Azure.Identity.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Azure.AI.OpenAI.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Azure.AI.OpenAI.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\OpenAI.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\OpenAI.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Microsoft.Bcl.AsyncInterfaces.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Microsoft.Bcl.AsyncInterfaces.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\System.ClientModel.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\System.ClientModel.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\System.Memory.Data.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\System.Memory.Data.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\System.Buffers.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\System.Buffers.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\System.Diagnostics.DiagnosticSource.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\System.Diagnostics.DiagnosticSource.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Markdig.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Markdig.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\ColorCode.Core.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\ColorCode.Core.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\ColorCode.Html.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\ColorCode.Html.dll" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\Resources\Copilot.html" target="lib\net452\Plugins\MarkMpn.Sql4Cds\Copilot.html" />
<file src="..\MarkMpn.Sql4Cds.XTB\bin\Release\QuikGraph.dll" target="lib\net452\Plugins\MarkMpn.Sql4Cds\QuikGraph.dll" />
</files>
</package>