-
Notifications
You must be signed in to change notification settings - Fork 301
Create and execute query to return tables and interpolated names for Autoentities #3082
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
Adds MSSQL support for querying autoentities include/exclude patterns and interpolated entity names, and wires this into metadata initialization with unit test coverage.
Changes:
- Added a new
BuildGetAutoentitiesQueryAPI to the query builder abstraction and implemented it for MSSQL. - Added MSSQL metadata-provider methods to execute the autoentities query during initialization and expose results for tests.
- Added unit tests intended to validate autoentities query output and fixed a typo in
MsSqlQueryExecutormethod name.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Service.Tests/UnitTests/SqlMetadataProviderUnitTests.cs | Adds unit test for autoentities query output (currently has correctness/compilation issues). |
| src/Core/Services/MetadataProviders/SqlMetadataProvider.cs | Calls into autoentities generation during MSSQL initialization. |
| src/Core/Services/MetadataProviders/MsSqlMetadataProvider.cs | Adds autoentities query execution hooks (currently discards results). |
| src/Core/Resolvers/MsSqlQueryExecutor.cs | Fixes ConfigureMsSqlQueryExecutor method spelling. |
| src/Core/Resolvers/MsSqlQueryBuilder.cs | Adds MSSQL T-SQL batch to fetch eligible tables and interpolated entity names (currently unsafe/invalid). |
| src/Core/Resolvers/IQueryBuilder.cs | Adds new autoentities query builder API as a default interface method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
left a comment
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.
Need to parameterize the executed query.
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
| RuntimeConfig runtimeConfig = _runtimeConfigProvider.GetConfig(); | ||
| await Task.CompletedTask; // Temporary await to suppress build errors. | ||
|
|
||
| /*RuntimeConfig runtimeConfig = _runtimeConfigProvider.GetConfig(); |
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.
remove comments from code, even if they are required in future
Aniruddh25
left a comment
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.
LGTM.
Why make this change?
include&excludeproperties for autoentities #2966We need to create a query and send it to the database in order to receive all of the tables that will be turned into entities from the autoentities configuration. This includes the
schema,object, andentity name.What is this change?
schema,object, andentity name, an example of this would bedbo,book,dbo.book. The query also transforms the reserved words{schema}and{object}into the tables schema and object and returns it in the name.How was this tested?