Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

IndexDefinition class is derived from TSqlStatement however it is not a statement

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
sql
Domain
compilers

Research direction

Start by tracing the inheritance of IndexDefinition, TSqlStatement, IndexStatement, and DropIndexStatement in the ScriptDOM source. Determine how inline index definitions are represented within CREATE TABLE and DECLARE TABLE, then assess the hierarchy change needed so only standalone statements derive from TSqlStatement; done means consumers can distinguish statements without special-casing IndexDefinition.

Written by the indexing model from the issue text.

Description

Inline indices are represented in ScriptDom as instances of IndexDefinition class. These index definitions in T-SQL can only be a part of CREATE TABLE/DECLARE TABLE statement and cannot be used as separate statements.

There is also IndexStatement class which represents CREATE/ALTER/DROP INDEX statements (well, drop has a separate implementation) which are true standalone statements.

While developing code analysis, code formatting, coverage computation tools one cannot be sure that descendant of TSqlStatement class is actually a statement and has to manually exclude/ignore instances of "false-statement" classes such as IndexDefinition.

It'd be great if such expressions which cannot exist separately from a surrounding statement were not derived from TSqlStatement class.

Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

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.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.