invalid field found for struct github.com/jackc/pgtype.Inet's field IPNet: define a valid foreign key for relations or implement the Valuer/Scanner interface #190
CREATE TABLE IF NOT EXISTS merchant (
id SERIAL NOT NULL UNIQUE,
bms_whitelist INET[] NOT NULL,
api_whitelist INET[] NOT NULL,
);
code
type Merchant struct{
Id uint64 `json:"id" gorm:"id"`
BmsWhitelist *pgtype.InetArray `json:"bms_whitelist" gorm:"bms_whitelist"`
ApiWhitelist *pgtype.InetArray `json:"api_whitelist" gorm:"api_whitelist"`
}
when I execute the query statement using gorm
[error] invalid field found for struct github.com/jackc/pgtype.Inet's field IPNet: define a valid foreign key for relations or implement the Valuer/Scanner interface
migrations
code
when I execute the query statement using gorm