Replies: 4 comments 1 reply
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
... thinking of this feature - go-structure composition can be used: type Entity struct {
gogm.BaseNode
DomainId string `gogm:"name=seId;pk=DomainId"`
}
type Agent struct {
Entity
AgentName string `gogm:"name=agentName"`
} in that case |
Beta Was this translation helpful? Give feedback.
-
@palandlom this would be really cool, but I feel like it could lead to some really weird edge cases. Like if one node had a relationship to another node but that node had multiple labels and the relationship was a subtype (like Although struct composition would be more elegant, I think the easier solution would be to have a reserved list of labels that have special meaning. |
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Do you have any plans of supporting multiple labels for nodes (structures) or some default(main) label for struct?
GOGM uses first label of node.
This leads to difficulties if additional labels are used.
For example:
The main label/entity is
Sensor
. In both cases it will be useful to load struct by GOGM (without any raw queries). But currently for the second case you need to haveActive
struct that is same asSensor
(with same links and etc).Some config for structs with main labels or with ignoring labels by GOGM will be really useful.
Beta Was this translation helpful? Give feedback.
All reactions