Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Option to normalize casing of identifiers in the ScriptGenerator

オープン
#177 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
sql
領域
databases

調査の方向性

まず ScriptGenerator と現在の設定を特定し、次に生成された SQL で識別子がどのように出力されるかを追跡します。大文字と小文字の扱いが一律に適用されるのか、それともインスタンスレベルとデータベースレベルで個別の設定が必要なのかを確認します。完了の条件は、PreserveOriginal がデフォルトのままであり、LowerCase と UpperCase が指定どおりに不変の大文字・小文字変換を使用することです。

索引モデルが issue の本文から書いたものです。

説明

formatting

SQL Server compares identifiers with respect to the CI/CS, AI/AS setting of the respective database's collation. While accent sensitivity has no effect on the SQL source code, case-sensitivity may have such an effect when the goal is to produce a 'canonical' form of the source code. The locale part of the collation plays no part in this.

Hence, the settings of the ScriptGenerator should be extended with an option to normalize casing of identifiers as follows:

  • PreserveOriginal — outputs identifiers as-is; this shall be the default behavior corresponding to the current state (no breaking change)
  • LowerCase — lower-case all identifiers when producing the output
  • UpperCase — upper-case all identifiers when producing the output

A simple ToLowerInvariant() / ToUpperInvariant() should be used.

Question is, whether the ScriptGenerator should support separate settings for instance-level (global) objects versus objects in a database. This would significantly increase the complexity. See also Database identifiers:

The collation of an identifier depends on the level at which it's defined. Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance. Identifiers of objects in a database, such as tables, views, and column names, are assigned the default collation of the database.

主要言語
GAP
スター
277
フォーク
43
平均マージ
6日 17時間
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/SqlScriptDOM のほかの issue

microsoft/SqlScriptDOM の issue をすべて見る

似ている issue

Databases の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。