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

Scaffolding against Azure Data Explorer with SQL Server emulation doesn't work #34833

Closed
barnuri opened this issue Oct 6, 2024 · 1 comment · Fixed by #34832
Closed

Scaffolding against Azure Data Explorer with SQL Server emulation doesn't work #34833

barnuri opened this issue Oct 6, 2024 · 1 comment · Fixed by #34832
Labels
area-scaffolding area-sqlserver closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. community-contribution customer-reported preview-1 type-enhancement
Milestone

Comments

@barnuri
Copy link
Contributor

barnuri commented Oct 6, 2024

using connection string of kusto like mention here

trying to scaffold via dotnet ef dbcontext scaffold

got this error

looks like OBJECT_SCHEMA_NAME method is not supported in kusto integration
https://learn.microsoft.com/en-us/azure/data-explorer/sql-server-emulation-overview

and i see the fix can be by modifying SupportsSequences() by detecting kusto
fix: /~https://github.com/dotnet/efcore/pull/34832/files

RequestId: TDS;906c6b05-c363-4ff3-9eea-0d7a2ef3fbff;10
Time: 2024-10-06T10:30:49.8561434Z
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs:line 2010
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in /_/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs:line 770
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs:line 1421
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs:line 2637
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData() in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs:line 1142
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData() in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs:line 258
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs:line 5171
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs:line 4984      
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs:line 4663
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs:line 4544
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) in /_/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs:line 2043
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
ClientConnectionId:906c6b05-c363-4ff3-9eea-0d7a2ef3fbff
Error Number:40000,State:1,Class:16
Request is invalid and cannot be processed: Semantic error: OTR0001: Scalar SQL function 'OBJECT_SCHEMA_NAME' is not supported. [line:position=2:5]
RequestId: TDS;906c6b05-c363-4ff3-9eea-0d7a2ef3fbff;10
Time: 2024-10-06T10:30:49.8561434Z```
@roji roji changed the title Scaffolding using kusto SQL Server emulation doesnt work Scaffolding using Kusto SQL Server emulation doesn't work Oct 7, 2024
@AndriySvyryd AndriySvyryd added this to the Backlog milestone Oct 8, 2024
@roji roji modified the milestones: Backlog, 10.0.0 Oct 14, 2024
@roji roji changed the title Scaffolding using Kusto SQL Server emulation doesn't work Scaffolding against Azure Data Explorer with SQL Server emulation doesn't work Oct 14, 2024
@roji roji closed this as completed in f157134 Oct 14, 2024
@ErikEJ
Copy link
Contributor

ErikEJ commented Oct 14, 2024

Available for EF Core 8 and 9 in EF Core Power Tools (VS extension and CLI)

@maumar maumar added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. preview-1 labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-scaffolding area-sqlserver closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. community-contribution customer-reported preview-1 type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants