Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 基于内容块属性动态建立对应数据库表结构 https://github.com/siyuan-note/siyuan/issues/7521

Liang Dingaa664856cca8
diff --git a/kernel/av/attribute_view.go b/kernel/av/attribute_view.go
index 4244d90472..7b85ffcca0 100644
--- a/kernel/av/attribute_view.go
+++ b/kernel/av/attribute_view.go
@@ -34,12 +34,19 @@ type AttributeView struct {
Columns []Column `json:"columns"` // 表格列名
Rows [][]string `json:"rows"` // 表格行记录
+ Type AttributeViewType `json:"type"` // 属性视图类型
Projections []string `json:"projections"` // 显示的列名,SELECT *
Filters []*AttributeViewFilter `json:"filters"` // 过滤规则,WHERE ...
Sorts []*AttributeViewSort `json:"sorts"` // 排序规则,ORDER BY ...
-
}
+// AttributeViewType 描述了属性视图的类型。
+type AttributeViewType string
+
+const (
+ AttributeViewTypeTable AttributeViewType = "table" // 属性视图类型 - 表格
+)
+
func (av *AttributeView) GetColumnNames() (ret []string) {
ret = []string{}
for _, column := range av.Columns {