Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4486b387
提交
4486b387
authored
8月 16, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove Type suffix from data types in documentation
上级
4d3a9d03
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
17 行删除
+21
-17
GenerateDoc.java
h2/src/tools/org/h2/build/doc/GenerateDoc.java
+21
-17
没有找到文件。
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
4486b387
...
@@ -71,35 +71,35 @@ public class GenerateDoc {
...
@@ -71,35 +71,35 @@ public class GenerateDoc {
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
IN_HELP
+
"', NULL, 'lineComment=#') WHERE SECTION "
;
IN_HELP
+
"', NULL, 'lineComment=#') WHERE SECTION "
;
map
(
"commandsDML"
,
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
true
);
help
+
"= 'Commands (DML)' ORDER BY ID"
,
true
,
false
);
map
(
"commandsDDL"
,
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
true
);
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
true
,
false
);
map
(
"commandsOther"
,
map
(
"commandsOther"
,
help
+
"= 'Commands (Other)' ORDER BY ID"
,
true
);
help
+
"= 'Commands (Other)' ORDER BY ID"
,
true
,
false
);
map
(
"datetimeFields"
,
map
(
"datetimeFields"
,
help
+
"= 'Datetime fields' ORDER BY ID"
,
true
);
help
+
"= 'Datetime fields' ORDER BY ID"
,
true
,
false
);
map
(
"otherGrammar"
,
map
(
"otherGrammar"
,
help
+
"= 'Other Grammar' ORDER BY ID"
,
true
);
help
+
"= 'Other Grammar' ORDER BY ID"
,
true
,
false
);
map
(
"functionsAggregate"
,
map
(
"functionsAggregate"
,
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
true
);
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
true
,
false
);
map
(
"functionsNumeric"
,
map
(
"functionsNumeric"
,
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
true
);
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
true
,
false
);
map
(
"functionsString"
,
map
(
"functionsString"
,
help
+
"= 'Functions (String)' ORDER BY ID"
,
true
);
help
+
"= 'Functions (String)' ORDER BY ID"
,
true
,
false
);
map
(
"functionsTimeDate"
,
map
(
"functionsTimeDate"
,
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
true
);
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
true
,
false
);
map
(
"functionsSystem"
,
map
(
"functionsSystem"
,
help
+
"= 'Functions (System)' ORDER BY ID"
,
true
);
help
+
"= 'Functions (System)' ORDER BY ID"
,
true
,
false
);
map
(
"dataTypes"
,
map
(
"dataTypes"
,
help
+
"LIKE 'Data Types%' ORDER BY SECTION, ID"
,
true
);
help
+
"LIKE 'Data Types%' ORDER BY SECTION, ID"
,
true
,
true
);
map
(
"intervalDataTypes"
,
map
(
"intervalDataTypes"
,
help
+
"LIKE 'Interval Data Types%' ORDER BY SECTION, ID"
,
true
);
help
+
"LIKE 'Interval Data Types%' ORDER BY SECTION, ID"
,
true
,
true
);
map
(
"informationSchema"
,
"SELECT TABLE_NAME TOPIC, "
+
map
(
"informationSchema"
,
"SELECT TABLE_NAME TOPIC, "
+
"GROUP_CONCAT(COLUMN_NAME "
+
"GROUP_CONCAT(COLUMN_NAME "
+
"ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX "
+
"ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' "
+
"WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' "
+
"GROUP BY TABLE_NAME ORDER BY TABLE_NAME"
,
false
);
"GROUP BY TABLE_NAME ORDER BY TABLE_NAME"
,
false
,
false
);
processAll
(
""
);
processAll
(
""
);
conn
.
close
();
conn
.
close
();
}
}
...
@@ -134,7 +134,7 @@ public class GenerateDoc {
...
@@ -134,7 +134,7 @@ public class GenerateDoc {
out
.
close
();
out
.
close
();
}
}
private
void
map
(
String
key
,
String
sql
,
boolean
railroads
)
private
void
map
(
String
key
,
String
sql
,
boolean
railroads
,
boolean
forDataTypes
)
throws
Exception
{
throws
Exception
{
ResultSet
rs
=
null
;
ResultSet
rs
=
null
;
Statement
stat
=
null
;
Statement
stat
=
null
;
...
@@ -146,13 +146,17 @@ public class GenerateDoc {
...
@@ -146,13 +146,17 @@ public class GenerateDoc {
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
ResultSetMetaData
meta
=
rs
.
getMetaData
();
ResultSetMetaData
meta
=
rs
.
getMetaData
();
for
(
int
i
=
0
;
i
<
meta
.
getColumnCount
();
i
++)
{
for
(
int
i
=
1
;
i
<=
meta
.
getColumnCount
();
i
++)
{
String
k
=
StringUtils
.
toLowerEnglish
(
meta
.
getColumnLabel
(
i
+
1
));
String
k
=
StringUtils
.
toLowerEnglish
(
meta
.
getColumnLabel
(
i
));
String
value
=
rs
.
getString
(
i
+
1
);
String
value
=
rs
.
getString
(
i
);
value
=
value
.
trim
();
value
=
value
.
trim
();
map
.
put
(
k
,
PageParser
.
escapeHtml
(
value
));
map
.
put
(
k
,
PageParser
.
escapeHtml
(
value
));
}
}
String
topic
=
rs
.
getString
(
"TOPIC"
);
String
topic
=
rs
.
getString
(
"TOPIC"
);
// Convert "INT Type" to "INT" etc.
if
(
forDataTypes
&&
topic
.
endsWith
(
" Type"
))
{
map
.
put
(
"topic"
,
topic
.
substring
(
0
,
topic
.
length
()
-
5
));
}
String
syntax
=
rs
.
getString
(
"SYNTAX"
).
trim
();
String
syntax
=
rs
.
getString
(
"SYNTAX"
).
trim
();
if
(
railroads
)
{
if
(
railroads
)
{
BnfRailroad
r
=
new
BnfRailroad
();
BnfRailroad
r
=
new
BnfRailroad
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论