Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for HasPrefix (0.27 sec)

  1. association.go

    	for name, ok := range selectColumns {
    		columnName := ""
    		if strings.HasPrefix(name, association.Relationship.Name) {
    			if columnName = strings.TrimPrefix(name, association.Relationship.Name); columnName == ".*" {
    				columnName = name
    			}
    		} else if strings.HasPrefix(name, clause.Associations) {
    			columnName = name
    		}
    
    		if columnName != "" {
    			if ok {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  2. utils/utils.go

    func FileWithLineNum() string {
    	// the second caller usually from gorm internal, so set i start from 2
    	for i := 2; i < 15; i++ {
    		_, file, line, ok := runtime.Caller(i)
    		if ok && (!strings.HasPrefix(file, gormSourceDir) || strings.HasSuffix(file, "_test.go")) &&
    			!strings.HasSuffix(file, ".gen.go") {
    			return file + ":" + strconv.FormatInt(int64(line), 10)
    		}
    	}
    
    	return ""
    }
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. callbacks/delete.go

    					for _, s := range db.Statement.Selects {
    						if s == clause.Associations {
    							selects = append(selects, s)
    						} else if columnPrefix := column + "."; strings.HasPrefix(s, columnPrefix) {
    							selects = append(selects, strings.TrimPrefix(s, columnPrefix))
    						}
    					}
    
    					if len(selects) > 0 {
    						tx = tx.Select(selects)
    					}
    				}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  4. migrator/migrator.go

    		isSameType  = fullDataType == realDataType
    	)
    
    	if !field.PrimaryKey {
    		// check type
    		if !strings.HasPrefix(fullDataType, realDataType) {
    			// check type aliases
    			aliases := m.DB.Migrator().GetTypeAliases(realDataType)
    			for _, alias := range aliases {
    				if strings.HasPrefix(fullDataType, alias) {
    					isSameType = true
    					break
    				}
    			}
    
    			if !isSameType {
    				alterColumn = true
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 28.5K bytes
    - Viewed (0)
  5. callbacks/associations.go

    		refName        = rel.Name + "."
    		values         = rValues.Interface()
    	)
    
    	for name, ok := range selectColumns {
    		columnName := ""
    		if strings.HasPrefix(name, refName) {
    			columnName = strings.TrimPrefix(name, refName)
    		}
    
    		if columnName != "" {
    			if ok {
    				selects = append(selects, columnName)
    			} else {
    				omits = append(omits, columnName)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  6. tests/migrate_test.go

    		Int8 Smallint
    	}
    
    	tracer := Tracer{
    		Logger: DB.Config.Logger,
    		Test: func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
    			sql, _ := fc()
    			if strings.HasPrefix(sql, "ALTER TABLE \"migrate_ints\" ALTER COLUMN \"int8\" TYPE smallint") {
    				t.Fatalf("shouldn't execute ALTER COLUMN TYPE if such type is already existed in DB schema: sql: %s",
    					sql)
    			}
    		},
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  7. finisher_api.go

    		}()
    	} else {
    		defer delete(tx.Statement.Clauses, "SELECT")
    	}
    
    	if len(tx.Statement.Selects) == 0 {
    		tx.Statement.AddClause(clause.Select{Expression: clause.Expr{SQL: "count(*)"}})
    	} else if !strings.HasPrefix(strings.TrimSpace(strings.ToLower(tx.Statement.Selects[0])), "count(") {
    		expr := clause.Expr{SQL: "count(*)"}
    
    		if len(tx.Statement.Selects) == 1 {
    			dbName := tx.Statement.Selects[0]
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
Back to top