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

This commit is contained in:
Liang Ding 2023-03-02 09:16:30 +08:00
parent 16b49bae37
commit aa664856cc
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

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