Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for math (0.14 sec)

  1. callbacks.go

    	return &callback{before: name, processor: p}
    }
    
    func (p *processor) After(name string) *callback {
    	return &callback{after: name, processor: p}
    }
    
    func (p *processor) Match(fc func(*DB) bool) *callback {
    	return &callback{match: fc, processor: p}
    }
    
    func (p *processor) Register(name string, fn func(*DB)) error {
    	return (&callback{processor: p}).Register(name, fn)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  2. schema/constraint.go

    package schema
    
    import (
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    )
    
    // reg match english letters and midline
    var regEnLetterAndMidline = regexp.MustCompile(`^[\w-]+$`)
    
    type CheckConstraint struct {
    	Name       string
    	Constraint string // length(phone) >= 10
    	*Field
    }
    
    func (chk *CheckConstraint) GetName() string { return chk.Name }
    
    func (chk *CheckConstraint) Build() (sql string, vars []interface{}) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  3. tests/joins_test.go

    	if err := query.First(&result, user.ID).Error; err != nil {
    		t.Fatalf("Failed, got error: %v", err)
    	}
    
    	if result.ID != user.ID {
    		t.Fatalf("result's id, %d, doesn't match user's id, %d", result.ID, user.ID)
    	}
    }
    
    func TestJoinWithSoftDeleted(t *testing.T) {
    	user := GetUser("TestJoinWithSoftDeletedUser", Config{Account: true, NamedPet: true})
    	DB.Create(&user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  4. tests/callbacks_test.go

    			}
    
    			if c.before != "" {
    				callMethod(v, "Before", c.before)
    			}
    
    			if c.after != "" {
    				callMethod(v, "After", c.after)
    			}
    
    			if c.match != nil {
    				callMethod(v, "Match", c.match)
    			}
    
    			if c.remove {
    				callMethod(v, "Remove", c.name)
    			} else if c.replace {
    				callMethod(v, "Replace", c.name, c.h)
    			} else {
    				callMethod(v, "Register", c.name, c.h)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  5. schema/schema_helper_test.go

    			if len(relations.Relations) != len(rs.Relations) {
    				t.Errorf("schema relations count don't match, expects %d, got %d", len(rs.Relations), len(relations.Relations))
    			}
    			if len(relations.EmbeddedRelations) != len(rs.EmbeddedRelations) {
    				t.Errorf("schema embedded relations count don't match, expects %d, got %d", len(rs.EmbeddedRelations), len(relations.EmbeddedRelations))
    			}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. utils/utils.go

    package utils
    
    import (
    	"database/sql/driver"
    	"fmt"
    	"path/filepath"
    	"reflect"
    	"runtime"
    	"strconv"
    	"strings"
    	"unicode"
    )
    
    var gormSourceDir string
    
    func init() {
    	_, file, _, _ := runtime.Caller(0)
    	// compatible solution to get gorm source directory with various operating systems
    	gormSourceDir = sourceDir(file)
    }
    
    func sourceDir(file string) string {
    	dir := filepath.Dir(file)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  7. callbacks/query.go

    							gussNestedRelations := make([]*schema.Relationship, 0, len(nestedJoinNames))
    							currentRelations := db.Statement.Schema.Relationships.Relations
    							for _, relname := range nestedJoinNames {
    								// incomplete match, only treated as raw sql
    								if relation, ok = currentRelations[relname]; ok {
    									gussNestedRelations = append(gussNestedRelations, relation)
    									currentRelations = relation.FieldSchema.Relationships.Relations
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  8. tests/migrate_test.go

    	if numField != len(columnTypes) {
    		t.Fatalf("column's number not match struct and ddl, %d != %d", numField, len(columnTypes))
    	}
    	namer := schema.NamingStrategy{}
    	for i := 0; i < numField; i++ {
    		expectName := namer.ColumnName("", typ.Field(i).Name)
    		if columnTypes[i].Name() != expectName {
    			t.Fatalf("column order not match struct and ddl, idx %d: %s != %s",
    				i, columnTypes[i].Name(), expectName)
    		}
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  9. errors.go

    	// ErrInvalidValue invalid value
    	ErrInvalidValue = errors.New("invalid value, should be pointer to struct or slice")
    	// ErrInvalidValueOfLength invalid values do not match length
    	ErrInvalidValueOfLength = errors.New("invalid association values, length doesn't match")
    	// ErrPreloadNotAllowed preload is not allowed when count is used
    	ErrPreloadNotAllowed = errors.New("preload is not allowed when count is used")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  10. utils/utils_test.go

    		out  string
    	}{
    		{"int", math.MaxInt64, "9223372036854775807"},
    		{"int8", int8(math.MaxInt8), "127"},
    		{"int16", int16(math.MaxInt16), "32767"},
    		{"int32", int32(math.MaxInt32), "2147483647"},
    		{"int64", int64(math.MaxInt64), "9223372036854775807"},
    		{"uint", uint(math.MaxUint64), "18446744073709551615"},
    		{"uint8", uint8(math.MaxUint8), "255"},
    		{"uint16", uint16(math.MaxUint16), "65535"},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top