Exec executes the UPSERT query and returns the inserted/updated ID.
(ctx context.Context)
| 1070 | |
| 1071 | // Exec executes the UPSERT query and returns the inserted/updated ID. |
| 1072 | func (u *MachineUpsertOne) ID(ctx context.Context) (id int, err error) { |
| 1073 | node, err := u.create.Save(ctx) |
| 1074 | if err != nil { |
| 1075 | return id, err |
| 1076 | } |
| 1077 | return node.ID, nil |
| 1078 | } |
| 1079 | |
| 1080 | // IDX is like ID, but panics if an error occurs. |
| 1081 | func (u *MachineUpsertOne) IDX(ctx context.Context) int { |