entc/gen: fixed unnamed field initialization (#2648)

* entc/gen: fixed ConstraintError fields name

* fix: run go generate

* entc/gen: fixed Filter fields name

* fix: run go generate again for entql
This commit is contained in:
Giau. Tran Minh
2022-06-14 16:32:46 +07:00
committed by GitHub
parent cd1afb235c
commit 195be2d98d
209 changed files with 512 additions and 512 deletions

View File

@@ -175,7 +175,7 @@ func (fc *FileCreate) sqlSave(ctx context.Context) (*File, error) {
_node, _spec := fc.createSpec()
if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
@@ -286,7 +286,7 @@ func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error) {
// Invoke the actual operation on the latest mutation in the chain.
if err = sqlgraph.BatchCreate(ctx, fcb.driver, spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
}
}

View File

@@ -302,7 +302,7 @@ func (fu *FileUpdate) sqlSave(ctx context.Context) (n int, err error) {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{file.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
@@ -621,7 +621,7 @@ func (fuo *FileUpdateOne) sqlSave(ctx context.Context) (_node *File, err error)
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{file.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}