sql2dbml fail to generate note if dbo specified
维护者通常 1 天内回复
@huydo862003 已经在做这个了。
开始于 2025年11月6日。
评估
这个 Issue 还没有评估数据。
描述
Hi,
When you explicitly specify the dbo schema in front of the table, if comments are added to a column with EXEC sp_addextendedproperty (by specifying the dbo schema), these will not appear in the "note" of the columns concerned in the generated dbml via sql2dbml
Let's take the DDL noschema_specified_is_OK.sql
>>> cat ok.sql
CREATE TABLE mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql noschema_specified_is_OK.sql
Table "mytable" {
"a" int [note: 'This is the description of my column']
}
All is fine here.
Now try with specified_schema_is_OK.sql
>>> cat specified_schema_is_OK.sql
CREATE TABLE myschema.mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'myschema',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql specified_schema_is_OK.sql
Table "myschema"."mytable" {
"a" int [note: 'This is the description of my column']
}
All is fine here.
Now try with replacing myschema by dbo in file specified_dbo_is_NOK.sql
>>> cat specified_dbo_is_NOK.sql
CREATE TABLE dbo.mytable(
a int
)
GO
EXEC sp_addextendedproperty
@name = N'Column_Description',
@value = 'This is the description of my column',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table', @level1name = 'mytable',
@level2type = N'Column', @level2name = 'a'
GO
>>> sql2dbml --mssql specified_dbo_is_NOK.sql
Table "dbo"."mytable" {
"a" int
}
In this case, there is a problem, the note corresponding to column's a comment doesn't appears
>>>sql2dbml --version
3.0.0
- 主要语言
- JavaScript
- 星标
- 3.7k
- 派生
- 233
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 23
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
holistics/dbml 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
@dbml/core 12.0.0 Postgres importer: timestamptz becomes timestamp, schema-qualified type doubled, Ref with ?<? rejected by parser可能已有人在做 @zzoraemon043 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 48/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
holistics/dbml#868 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
mailcow/mailcow-dockerized#7677 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
gcivil-nyu-org/team5-mon-fall26#145 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
needs discussion
难度 2/5 1-3 小时 新手友好度 78/100
openfga/openfga.dev#1436 · 1 条评论 ·
维护者通常 2 天内回复