From bfda75d0991f15200af1768bd9fe32040c219a29 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sat, 9 Oct 2021 10:42:41 +0800 Subject: [PATCH] Support specify select/omit columns with table --- statement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statement.go b/statement.go index bea4f7f0..c631031e 100644 --- a/statement.go +++ b/statement.go @@ -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) {