type SubProperties struct {
ID string
Contract string
Type string
Name string
}
type Properties struct {
Channel string
SubProperties
}
p := Properties{
Channel: "aaaa",
SubProperties: SubProperties{
ID: "ID3333",
Contract: "c3",
Type: "ty3",
Name: "n3",
},
}
Db.Table(strings.ToUpper(p.Channel) + "Attr").Create(p.SubProperties)
保存后 ID值为c3, Contract为ty3, Type为n3,Name为ID3333
当前版本0.5.0
表结构
CREATE TABLE FFAttr
(
id String,
contract String,
type String,
name String
)
ENGINE = MergeTree
PRIMARY KEY (contract, type)
ORDER BY (contract, type)
The document you expected this should be explained
保存后 ID值为c3, Contract为ty3, Type为n3,Name为ID3333
当前版本0.5.0
表结构 CREATE TABLE FFAttr (
id
String,contract
String,type
String,name
String ) ENGINE = MergeTree PRIMARY KEY (contract, type) ORDER BY (contract, type)The document you expected this should be explained
Expected answer