Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Atoi (0.18 sec)

  1. logger/sql.go

    		sql = newSQL.String()
    	} else {
    		sql = numericPlaceholder.ReplaceAllString(sql, "$$$1$$")
    
    		sql = numericPlaceholderRe.ReplaceAllStringFunc(sql, func(v string) string {
    			num := v[1 : len(v)-1]
    			n, _ := strconv.Atoi(num)
    
    			// position var start from 1 ($1, $2)
    			n -= 1
    			if n >= 0 && n <= len(vars)-1 {
    				return vars[n]
    			}
    			return v
    		})
    	}
    
    	return sql
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  2. schema/index.go

    					tag        = strings.Join(v[1:], ":")
    					idx        = strings.Index(tag, ",")
    					tagSetting = strings.Join(strings.Split(tag, ",")[1:], ",")
    					settings   = ParseTagSetting(tagSetting, ",")
    					length, _  = strconv.Atoi(settings["LENGTH"])
    				)
    
    				if idx == -1 {
    					idx = len(tag)
    				}
    
    				if idx != -1 {
    					name = tag[0:idx]
    				}
    
    				if name == "" {
    					subName := field.Name
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. tests/scanner_valuer_test.go

    	}
    
    	// prepend asterisks
    	return append([]byte("***"), data...), nil
    }
    
    type Num int64
    
    func (i *Num) Scan(src interface{}) error {
    	switch s := src.(type) {
    	case []byte:
    		n, _ := strconv.Atoi(string(s))
    		*i = Num(n)
    	case int64:
    		*i = Num(s)
    	default:
    		return errors.New("Cannot scan NamedInt from " + reflect.ValueOf(src).String())
    	}
    	return nil
    }
    
    type StringsSlice []string
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  4. statement.go

    func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []clause.Expression {
    	if s, ok := query.(string); ok {
    		// if it is a number, then treats it as primary key
    		if _, err := strconv.Atoi(s); err != nil {
    			if s == "" && len(args) == 0 {
    				return nil
    			}
    
    			if len(args) == 0 || (len(args) > 0 && strings.Contains(s, "?")) {
    				// looks like a where condition
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  5. schema/field.go

    	}
    
    	if num, ok := field.TagSettings["SIZE"]; ok {
    		if field.Size, err = strconv.Atoi(num); err != nil {
    			field.Size = -1
    		}
    	}
    
    	if p, ok := field.TagSettings["PRECISION"]; ok {
    		field.Precision, _ = strconv.Atoi(p)
    	}
    
    	if s, ok := field.TagSettings["SCALE"]; ok {
    		field.Scale, _ = strconv.Atoi(s)
    	}
    
    	// default value is function or null or blank (primary keys)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top