Skip to content

Revert "feat(database/gdb): Added OmitZero function to filter zero value parameters" - #4818

Merged
hailaz merged 1 commit into
masterfrom
revert-4713-fix/omitzero
Jul 30, 2026
Merged

Revert "feat(database/gdb): Added OmitZero function to filter zero value parameters"#4818
hailaz merged 1 commit into
masterfrom
revert-4713-fix/omitzero

Conversation

@hailaz

@hailaz hailaz commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Reverts #4713

Copilot AI review requested due to automatic review settings July 30, 2026 08:29
@hailaz
hailaz merged commit 9de28eb into master Jul 30, 2026
18 of 20 checks passed
@hailaz
hailaz deleted the revert-4713-fix/omitzero branch July 30, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the previously added “OmitZero” functionality in database/gdb, removing both the model options and the underlying zero-value detection helper that supported filtering zero-value parameters in Where/Having and Data handling.

Changes:

  • Removed empty.IsZero (and its unit tests) from internal/empty.
  • Removed OmitZero* model options/bitflags and all related filtering logic from database/gdb.
  • Removed MySQL driver integration tests that exercised OmitZero* behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/empty/empty.go Removes IsZero helper and its related interface.
internal/empty/empty_z_unit_test.go Removes unit tests for the removed IsZero behavior.
database/gdb/gdb_model_utility.go Removes zero-value filtering for insert/update data maps.
database/gdb/gdb_model_select.go Stops passing OmitZero into where/having formatting.
database/gdb/gdb_model_option.go Removes OmitZero* option constants and public model methods.
database/gdb/gdb_model_builder.go Stops passing OmitZero into builder where formatting.
database/gdb/gdb_func.go Removes OmitZero support from where-holder formatting and helpers.
contrib/drivers/mysql/mysql_z_unit_model_test.go Removes integration tests for OmitZero* model options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to +13
const (
optionOmitNil = optionOmitNilWhere | optionOmitNilData
optionOmitEmpty = optionOmitEmptyWhere | optionOmitEmptyData
optionOmitZero = optionOmitZeroWhere | optionOmitZeroData
optionOmitNilDataInternal = optionOmitNilData | optionOmitNilDataList // this option is used internally only for ForDao feature.
optionOmitEmptyWhere = 1 << iota // 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants