microsoft / microsoft/DacFx

Open internal utils for matching ColumnReferenceExpression to object in SchemaModel

Open
#404 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

We are trying to match column references from the ScriptDom with columns in the schema (for example to check for non-indexed columns during static code analysis). Sounds easy, but it is not trivial at all.

The factory rule NonIndexedColumnFromInPredicateRule in Dac.Extensions is similar with what we aim for, but the implementation goes really deep and complex for matching the column, and all the utils and tools in the implementation are internal.

It would be amazing to have access to these utils, as it would allow for more advanced custom code analysis rules to be written.
Even if the actual implementation remains mostly internal sealed as it is now, maybe expose a few methods that'll try to do the binding (even if it is ambiguous).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the NonIndexedColumnFromInPredicateRule in Dac.Extensions and trace how it matches ScriptDom column references to the SchemaModel. The issue does not name implementation files or tests, so first identify the internal utilities involved. Done means exposing a supported way for custom analysis rules to attempt this binding, including ambiguous matches.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
databases, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.