Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Option to normalize casing of identifiers in the ScriptGenerator

未关闭
#177 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/SqlScriptDOM 的其他 Issue

查看 microsoft/SqlScriptDOM 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。