Closed OSHW-Rico closed 2 years ago
I don't understand all your magic how the model is build, but the model of Driver
does not have any Primary Keys.
// Driver represents an driver record.
type Driver struct {
SessionID int
CarIdx int `yaml:"CarIdx"`
UserName string `yaml:"UserName"`
AbbrevName string `yaml:"AbbrevName"`
Initials string `yaml:"Initials"`
Found the solution.
https://github.com/go-ozzo/ozzo-dbx#crud-operations
If the struct has a field named ID or Id, by default the field will be treated as the primary key field. If you want to use a different field as the primary key, tag it with db:"pk". You may tag multiple fields for composite primary keys. Note that if you also want to explicitly specify the column name for a primary key field, you should use the tag format db:"pk,col_name".
I am trying to update with:
.
The SessionID and CardIdx are the primary key fields.