pg
pg copied to clipboard
how does go-pg covers linked tables
Having three tables with the following specifications:
type Devices struct {
ID int
Name string
}
and
type Features struct {
ID int
Name string
}
I have created a linked table specified by the following struct:
type DevicesFeatures struct {
DeviceID int
Device *Devices
FeatureID int
Feature *Feature
}
I want to select all the devices and their features if any. Would you please help me how to select them all? `
Sorry if you find it primitive!
`
Hey,
You should check out my thread https://github.com/go-pg/pg/issues/1591. Check the tables Contracts -> ClientMaps <- Clients. That's how you do the thing you want :).