Skip to content

database/gdb: FieldsEx feature conflicts with soft time feature in soft time fields updating #3754

@chaseSpace

Description

@chaseSpace

Go version

1.21.12

GoFrame version

v2.7.2

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

Snippet: dao.XXX.GetDB(ctx).Where("id", id).FieldsEx("updated_at").Update(XXXObj);

What did you see happen?

This operation will continue to update the updated_at field with value of object. Is this behavior what the designer intended? I suspect it might not be, and I also don't think it's a good idea. Because this behavior is certainly an unexpected for developer. All right, i have to query docs to find a reasonable statement from administrtor, this is not a good experience.

Note that the Unscope API is not under discussion here.

What did you expect to see?

If developer called FieldsEx API to exclude updated_at fields or any other, which all should not be continue to controll with select/save/update operation.

Metadata

Metadata

Assignees

Labels

bugIt is confirmed a bug, but don't worry, we'll handle it.doneThis issue is done, which may be release in next version.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions