if len(update) == 0 {
return errors.New("models: unable to upsert somemodel, could not build update column list")
}
I was invoking this method passing updateOnConflict=false. Given that I do not want any updates, I am passing updateColumns=boil.Whitelist() -- the empty list.
Expected result: this works fine, I am not updating anything after all.
Actual result: the if pasted above causes an error.
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?v3.1.0
Further information. What did you do, what did you expect?
The generated
Upsert
has the following signature:func (o *SomeModel) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error
Its implementation body contains this line:
I was invoking this method passing
updateOnConflict=false
. Given that I do not want any updates, I am passingupdateColumns=boil.Whitelist()
-- the empty list.Expected result: this works fine, I am not updating anything after all.
Actual result: the
if
pasted above causes an error.