(ctx context.Context, key string, value string)
| 22 | } |
| 23 | |
| 24 | func (c *Client) SetConfigItem(ctx context.Context, key string, value string) error { |
| 25 | err := c.Ent.ConfigItem. |
| 26 | Create(). |
| 27 | SetName(key). |
| 28 | SetValue(value). |
| 29 | OnConflictColumns(configitem.FieldName). |
| 30 | UpdateNewValues(). |
| 31 | Exec(ctx) |
| 32 | if err != nil { |
| 33 | return fmt.Errorf("insert/update config item: %w", err) |
| 34 | } |
| 35 | |
| 36 | return nil |
| 37 | } |
no test coverage detected