Skip to content

New feature: Ignore empty content to prevent the output of incorrect SQL

Compare
Choose a tag to compare
@huandu huandu released this 28 Oct 06:13
· 10 commits to master since this release
be6fb8b

What's Changed

  • Cond and WhereClause will actively ignore empty content to prevent the output of syntactically incorrect SQL #175 by @rodionovv
    • In previous version, Cond and WhereClause can produce syntax errors when any of required parameters field, op or expr is empty. This release fixes this issue by actively ignore these invalid values.
    • Here are samples affected by this change.
      • Select("*").From("t").Where("").String()
        • Now: SELECT * FROM t
        • Previous version: SELECT * FROM t WHERE
      • sb := Select("*").From("t"); sb.Where(sb.Equal("", 0))
        • Now: SELECT * FROM t
        • Previous version: SELECT * FROM t WHERE = ?

New Contributors

Full Changelog: v1.30.0...v1.31.0