Skip to content

Add safe condition checks#951

Open
bnvnvnv wants to merge 1 commit into
abel533:masterfrom
bnvnvnv:safe-condition-checks
Open

Add safe condition checks#951
bnvnvnv wants to merge 1 commit into
abel533:masterfrom
bnvnvnv:safe-condition-checks

Conversation

@bnvnvnv

@bnvnvnv bnvnvnv commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Add a safe select option and extend safe condition validation to avoid accidental full-table operations when upstream passes empty parameters.

  • add safeSelect configuration and wire it into object and Example select providers
  • require object-based CRUD safety checks to have at least one effective WHERE condition
  • make Example safety checks reject empty condition values, including null, empty string, empty collection, and empty array
  • cover tk.mybatis Example and generated Example styles in tests

Validation

  • mvn -pl base -am -Dtest=SafeSelectByFieldTest,SafeDeleteByFieldTest,SafeDeleteByMethodTest,SafeUpdateByFieldTest,SafeUpdateByMethodTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -pl base -am -DfailIfNoTests=false test
  • git diff --check

@bnvnvnv
bnvnvnv marked this pull request as ready for review July 22, 2026 10:08
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.

2 participants