mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 基于内容块属性动态建立对应数据库表结构 https://github.com/siyuan-note/siyuan/issues/7521
This commit is contained in:
parent
16b49bae37
commit
aa664856cc
1 changed files with 8 additions and 1 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue