Support specify select/omit columns with table

This commit is contained in:
Jinzhu 2021-10-09 10:42:41 +08:00
parent 6312d86c54
commit bfda75d099
1 changed files with 1 additions and 1 deletions

View File

@ -628,7 +628,7 @@ func (stmt *Statement) Changed(fields ...string) bool {
return false
}
var nameMatcher = regexp.MustCompile(`\.[\W]?(.+?)[\W]?$`)
var nameMatcher = regexp.MustCompile(`^[\W]?(?:[a-z_]+?)[\W]?\.[\W]?([a-z_]+?)[\W]?$`)
// SelectAndOmitColumns get select and omit columns, select -> true, omit -> false
func (stmt *Statement) SelectAndOmitColumns(requireCreate, requireUpdate bool) (map[string]bool, bool) {