Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
842f854f
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
842f854f
编写于
3月 31, 2021
作者:
S
ShadelessFox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#11058 Use unicode prefix for strings
上级
59c86092
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
16 deletion
+36
-16
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerBaseTableManager.java
...iss/dbeaver/ext/mssql/edit/SQLServerBaseTableManager.java
+4
-4
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerProcedureManager.java
...iss/dbeaver/ext/mssql/edit/SQLServerProcedureManager.java
+3
-3
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerTableColumnManager.java
...s/dbeaver/ext/mssql/edit/SQLServerTableColumnManager.java
+4
-4
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerDialect.java
...c/org/jkiss/dbeaver/ext/mssql/model/SQLServerDialect.java
+23
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/sql/SQLUtils.java
...eaver.model/src/org/jkiss/dbeaver/model/sql/SQLUtils.java
+2
-5
未找到文件。
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerBaseTableManager.java
浏览文件 @
842f854f
...
...
@@ -59,9 +59,9 @@ public abstract class SQLServerBaseTableManager<OBJECT extends SQLServerTableBas
new
SQLDatabasePersistAction
(
"Add table comment"
,
"EXEC "
+
SQLServerUtils
.
getSystemTableName
(
table
.
getDatabase
(),
isUpdate
?
"sp_updateextendedproperty"
:
"sp_addextendedproperty"
)
+
" 'MS_Description',
N"
+
SQLUtils
.
quoteString
(
command
.
getObject
(),
command
.
getObject
()
.
getDescription
())
+
","
+
" 'schema',
N'"
+
table
.
getSchema
().
getName
()
+
"'
,"
+
" '"
+
(
table
.
isView
()
?
"view"
:
"table"
)
+
"',
N'"
+
table
.
getName
()
+
"'"
));
" 'MS_Description',
"
+
SQLUtils
.
quoteString
(
table
,
table
.
getDescription
())
+
","
+
" 'schema',
"
+
SQLUtils
.
quoteString
(
table
,
table
.
getSchema
().
getName
())
+
"
,"
+
" '"
+
(
table
.
isView
()
?
"view"
:
"table"
)
+
"',
"
+
SQLUtils
.
quoteString
(
table
,
table
.
getName
())
));
}
}
...
...
@@ -74,7 +74,7 @@ public abstract class SQLServerBaseTableManager<OBJECT extends SQLServerTableBas
"Rename table"
,
"EXEC "
+
SQLServerUtils
.
getSystemTableName
(
object
.
getDatabase
(),
"sp_rename"
)
+
" N'"
+
object
.
getSchema
().
getFullyQualifiedName
(
DBPEvaluationContext
.
DML
)
+
"."
+
DBUtils
.
getQuotedIdentifier
(
object
.
getDataSource
(),
command
.
getOldName
())
+
"'
, N'"
+
DBUtils
.
getQuotedIdentifier
(
object
.
getDataSource
(),
command
.
getNewName
())
+
"'
, 'OBJECT'"
)
"'
, "
+
SQLUtils
.
quoteString
(
object
.
getDataSource
(),
command
.
getNewName
())
+
"
, 'OBJECT'"
)
);
}
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerProcedureManager.java
浏览文件 @
842f854f
...
...
@@ -120,9 +120,9 @@ public class SQLServerProcedureManager extends SQLServerObjectManager<SQLServerP
new
SQLDatabasePersistAction
(
"Add procedure comment"
,
"EXEC "
+
SQLServerUtils
.
getSystemTableName
(
database
,
isUpdate
?
"sp_updateextendedproperty"
:
"sp_addextendedproperty"
)
+
" 'MS_Description',
N"
+
SQLUtils
.
quoteString
(
command
.
getObject
(),
command
.
getObject
()
.
getDescription
())
+
","
+
" 'schema',
N'"
+
procedure
.
getContainer
().
getName
()
+
"'
,"
+
" 'procedure',
N'"
+
procedure
.
getName
()
+
"'"
));
" 'MS_Description',
"
+
SQLUtils
.
quoteString
(
procedure
,
procedure
.
getDescription
())
+
","
+
" 'schema',
"
+
SQLUtils
.
quoteString
(
procedure
,
procedure
.
getContainer
().
getName
())
+
"
,"
+
" 'procedure',
"
+
SQLUtils
.
quoteString
(
procedure
,
procedure
.
getName
())
));
}
}
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/edit/SQLServerTableColumnManager.java
浏览文件 @
842f854f
...
...
@@ -170,10 +170,10 @@ public class SQLServerTableColumnManager extends SQLTableColumnManager<SQLServer
new
SQLDatabasePersistAction
(
"Add column comment"
,
"EXEC "
+
SQLServerUtils
.
getSystemTableName
(
column
.
getTable
().
getDatabase
(),
isUpdate
?
"sp_updateextendedproperty"
:
"sp_addextendedproperty"
)
+
" 'MS_Description',
N"
+
SQLUtils
.
quoteString
(
command
.
getObject
(),
command
.
getObject
()
.
getDescription
())
+
","
+
" 'schema',
N'"
+
column
.
getTable
().
getSchema
().
getName
()
+
"'
,"
+
" 'table',
N'"
+
column
.
getTable
().
getName
()
+
"'
,"
+
" 'column',
N'"
+
column
.
getName
()
+
"'"
));
" 'MS_Description',
"
+
SQLUtils
.
quoteString
(
column
,
column
.
getDescription
())
+
","
+
" 'schema',
"
+
SQLUtils
.
quoteString
(
column
,
column
.
getTable
().
getSchema
().
getName
())
+
"
,"
+
" 'table',
"
+
SQLUtils
.
quoteString
(
column
,
column
.
getTable
().
getName
())
+
"
,"
+
" 'column',
"
+
SQLUtils
.
quoteString
(
column
,
column
.
getName
())
));
}
if
(
totalProps
>
0
)
{
actionList
.
add
(
new
SQLDatabasePersistAction
(
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerDialect.java
浏览文件 @
842f854f
...
...
@@ -248,4 +248,27 @@ public class SQLServerDialect extends JDBCSQLDialect {
sql
.
append
(
"\nSELECT\t'Return Value' = @return_value\n\n"
);
sql
.
append
(
"GO\n\n"
);
}
@Override
public
boolean
isQuotedString
(
String
string
)
{
if
(
string
.
length
()
>=
3
&&
string
.
charAt
(
0
)
==
'N'
)
{
// https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql
return
super
.
isQuotedString
(
string
.
substring
(
1
));
}
return
super
.
isQuotedString
(
string
);
}
@Override
public
String
getQuotedString
(
String
string
)
{
return
'N'
+
super
.
getQuotedString
(
string
);
}
@Override
public
String
getUnquotedString
(
String
string
)
{
if
(
string
.
length
()
>=
3
&&
string
.
charAt
(
0
)
==
'N'
)
{
// https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql
return
super
.
getUnquotedString
(
string
.
substring
(
1
));
}
return
super
.
getUnquotedString
(
string
);
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/sql/SQLUtils.java
浏览文件 @
842f854f
...
...
@@ -660,12 +660,9 @@ public final class SQLUtils {
case
STRING:
case
ROWID:
if
(
sqlDialect
!=
null
)
{
strValue
=
sqlDialect
.
escapeString
(
strValue
);
return
sqlDialect
.
getTypeCastClause
(
attribute
,
sqlDialect
.
getQuotedString
(
strValue
)
);
}
if
(
dataKind
==
DBPDataKind
.
STRING
||
!(
strValue
.
startsWith
(
"'"
)
&&
strValue
.
endsWith
(
"'"
)))
{
strValue
=
'\''
+
strValue
+
'\''
;
}
return
sqlDialect
.
getTypeCastClause
(
attribute
,
strValue
);
return
strValue
;
default
:
if
(
sqlDialect
!=
null
)
{
return
sqlDialect
.
escapeScriptValue
(
attribute
,
value
,
strValue
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录