mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 21:50:43 +08:00
Part of the English translation work, and some typos in the original project were corrected.
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<!--properties的配置文件会和编译后的class文件放在一起-->
|
||||
<!--The properties configuration file will be placed together with the compiled class file-->
|
||||
<include>**/*.json</include>
|
||||
</includes>
|
||||
</resource>
|
||||
|
@ -34,7 +34,7 @@ public class H2Meta extends DefaultMetaService implements MetaData {
|
||||
|
||||
private String getDDL(Connection connection, String databaseName, String schemaName, String tableName) {
|
||||
try {
|
||||
// 查询表结构信息
|
||||
// Query table structure information
|
||||
ResultSet columns = connection.getMetaData().getColumns(databaseName, schemaName, tableName, null);
|
||||
List<String> columnDefinitions = new ArrayList<>();
|
||||
while (columns.next()) {
|
||||
@ -59,7 +59,7 @@ public class H2Meta extends DefaultMetaService implements MetaData {
|
||||
columnDefinitions.add(columnDefinition.toString());
|
||||
}
|
||||
|
||||
// 查询表索引信息
|
||||
// Query table index information
|
||||
ResultSet indexes = connection.getMetaData().getIndexInfo(databaseName, schemaName, tableName, false,
|
||||
false);
|
||||
Map<String, List<String>> indexMap = new HashMap<>();
|
||||
@ -77,7 +77,7 @@ public class H2Meta extends DefaultMetaService implements MetaData {
|
||||
createTableDDL.append(tableName).append(" (\n");
|
||||
createTableDDL.append(String.join(",\n", columnDefinitions));
|
||||
createTableDDL.append("\n);\n");
|
||||
// 输出索引信息
|
||||
// Output index information
|
||||
for (Map.Entry<String, List<String>> entry : indexMap.entrySet()) {
|
||||
String indexName = entry.getKey();
|
||||
List<String> columnList = entry.getValue();
|
||||
|
Reference in New Issue
Block a user