Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for MustCompile (0.04 sec)

  1. statement.go

    				if changed(field) {
    					return true
    				}
    			}
    		}
    	}
    
    	return false
    }
    
    var matchName = func() func(tableColumn string) (table, column string) {
    	nameMatcher := regexp.MustCompile(`^(?:\W?(\w+?)\W?\.)?(?:(\*)|\W?(\w+?)\W?)$`)
    	return func(tableColumn string) (table, column string) {
    		if matches := nameMatcher.FindStringSubmatch(tableColumn); len(matches) == 4 {
    			table = matches[1]
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 20.8K bytes
    - Viewed (0)
  2. tests/generics_test.go

    	}
    }
    
    func TestGenericsToSQL(t *testing.T) {
    	ctx := context.Background()
    	sql := DB.ToSQL(func(tx *gorm.DB) *gorm.DB {
    		gorm.G[User](tx).Limit(10).Find(ctx)
    		return tx
    	})
    
    	if !regexp.MustCompile("SELECT \\* FROM .users..* 10").MatchString(sql) {
    		t.Errorf("ToSQL: got wrong sql with Generics API %v", sql)
    	}
    }
    
    func TestGenericsScanUUID(t *testing.T) {
    	ctx := context.Background()
    	users := []User{
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 28K bytes
    - Viewed (0)
Back to top