feat: 更新数据库时支持同步保存子表配置和DDL
- UpdateDatabaseRequest 添加 SubTables 字段 - 数据库更新时同步创建或更新子表记录 - 支持子表 DDL 的保存 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,21 +54,22 @@ type CreateDatabaseRequest struct {
|
||||
|
||||
// UpdateRequest 更新数据库信息请求
|
||||
type UpdateDatabaseRequest struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
DBType string `json:"db_type"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Database string `json:"database"`
|
||||
TableCount int `json:"table_count"`
|
||||
Charset string `json:"charset"`
|
||||
SSLMode string `json:"ssl_mode"`
|
||||
URI string `json:"uri"` // Neo4j 连接地址
|
||||
GraphLabels string `json:"graph_labels"` // Neo4j 标签列表 (JSON)
|
||||
GraphRelationship string `json:"graph_relationship"` // Neo4j 关系类型列表 (JSON)
|
||||
SelectedLabel string `json:"selected_label"` // 当前选中的标签
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
DBType string `json:"db_type"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Database string `json:"database"`
|
||||
TableCount int `json:"table_count"`
|
||||
Charset string `json:"charset"`
|
||||
SSLMode string `json:"ssl_mode"`
|
||||
URI string `json:"uri"` // Neo4j 连接地址
|
||||
GraphLabels string `json:"graph_labels"` // Neo4j 标签列表 (JSON)
|
||||
GraphRelationship string `json:"graph_relationship"` // Neo4j 关系类型列表 (JSON)
|
||||
SelectedLabel string `json:"selected_label"` // 当前选中的标签
|
||||
SubTables []CreateSubTableRequest `json:"sub_tables"` // 子表配置
|
||||
}
|
||||
|
||||
// SaveGraphRequest 保存图谱信息请求
|
||||
|
||||
@@ -95,6 +95,7 @@ type CreateSubTableRequest struct {
|
||||
RelationField string `json:"relation_field"`
|
||||
RelationType string `json:"relation_type"`
|
||||
Fields []FieldMapping `json:"fields"` // 字段映射列表
|
||||
DDL string `json:"ddl"` // 建表DDL
|
||||
}
|
||||
|
||||
// UpdateSubTableRequest 更新子表请求
|
||||
@@ -105,6 +106,7 @@ type UpdateSubTableRequest struct {
|
||||
MappingType string `json:"mapping_type"`
|
||||
RelationField string `json:"relation_field"`
|
||||
RelationType string `json:"relation_type"`
|
||||
DDL string `json:"ddl"`
|
||||
}
|
||||
|
||||
// SubTableMapping 完整的子表映射配置(存储到文件的格式)
|
||||
|
||||
Reference in New Issue
Block a user