2026-05-14 22:36:04 +08:00
|
|
|
package tableDB
|
|
|
|
|
|
2026-05-15 12:12:04 +08:00
|
|
|
type TableSchema struct {
|
|
|
|
|
ID string
|
|
|
|
|
Name string
|
|
|
|
|
Memo string
|
|
|
|
|
EnableRLS bool
|
|
|
|
|
Settings map[string]any
|
2026-05-16 01:04:46 +08:00
|
|
|
IsSecret bool // 是否敏感表(不被索引)
|
2026-05-15 12:12:04 +08:00
|
|
|
CreateTime int64
|
|
|
|
|
Creator string
|
2026-05-16 01:04:46 +08:00
|
|
|
UpdateTime int64
|
|
|
|
|
Updater string
|
2026-05-15 12:12:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FlatPolicy struct {
|
|
|
|
|
Condition string
|
|
|
|
|
ConditionArgs []any
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PolicySchema struct {
|
|
|
|
|
ID string
|
|
|
|
|
UserID string
|
|
|
|
|
Type string // inherit, table
|
|
|
|
|
Targets []string
|
|
|
|
|
Action string // read, write, full
|
|
|
|
|
Condition string
|
|
|
|
|
ConditionArgs []any
|
|
|
|
|
CreateTime int64
|
|
|
|
|
Creator string
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-14 22:36:04 +08:00
|
|
|
type FieldSchema struct {
|
2026-05-15 12:12:04 +08:00
|
|
|
ID string
|
|
|
|
|
TableID string
|
|
|
|
|
Name string
|
|
|
|
|
Type string
|
|
|
|
|
IsIndex bool
|
|
|
|
|
Memo string
|
|
|
|
|
Settings map[string]any
|
|
|
|
|
CreateTime int64
|
|
|
|
|
Creator string
|
2026-05-14 22:36:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type QueryRequest struct {
|
|
|
|
|
Select []string
|
|
|
|
|
Joins []JoinConfig
|
|
|
|
|
Where string
|
|
|
|
|
OrderBy string
|
|
|
|
|
Limit int
|
|
|
|
|
Offset int
|
|
|
|
|
Args []any
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type JoinConfig struct {
|
|
|
|
|
Table string
|
|
|
|
|
Type string
|
|
|
|
|
On string
|
|
|
|
|
}
|