Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for Schick (0.22 sec)

  1. schema/constraint.go

    	return "CONSTRAINT ? CHECK (?)", []interface{}{clause.Column{Name: chk.Name}, clause.Expr{SQL: chk.Constraint}}
    }
    
    // ParseCheckConstraints parse schema check constraints
    func (schema *Schema) ParseCheckConstraints() map[string]CheckConstraint {
    	checks := map[string]CheckConstraint{}
    	for _, field := range schema.FieldsByDBName {
    		if chk := field.TagSettings["CHECK"]; chk != "" {
    			names := strings.Split(chk, ",")
    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)
  2. prepare_stmt.go

    		// wait for other goroutines prepared
    		<-stmt.prepared
    		if stmt.prepareErr != nil {
    			return Stmt{}, stmt.prepareErr
    		}
    
    		return *stmt, nil
    	}
    	db.Mux.RUnlock()
    
    	db.Mux.Lock()
    	// double check
    	if stmt, ok := db.Stmts[query]; ok && (!stmt.Transaction || isTransaction) {
    		db.Mux.Unlock()
    		// wait for other goroutines prepared
    		<-stmt.prepared
    		if stmt.prepareErr != nil {
    			return Stmt{}, stmt.prepareErr
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  3. errors.go

    	ErrForeignKeyViolated = errors.New("violates foreign key constraint")
    	// ErrCheckConstraintViolated occurs when there is a check constraint violation
    	ErrCheckConstraintViolated = errors.New("violates check constraint")
    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)
  4. migrator.go

    }
    
    // ViewOption view option
    type ViewOption struct {
    	Replace     bool   // If true, exec `CREATE`. If false, exec `CREATE OR REPLACE`
    	CheckOption string // optional. e.g. `WITH [ CASCADED | LOCAL ] CHECK OPTION`
    	Query       *DB    // required subquery.
    }
    
    // ColumnType column type interface
    type ColumnType interface {
    	Name() string
    	DatabaseTypeName() string                 // varchar
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. tests/migrate_test.go

    			t.Fatalf("Should have index on %s", "CompanyI.")
    		}
    
    		if !m.HasIndex(&DynamicUser{}, "DeletedAt") {
    			t.Fatalf("Should have index on deleted_at.")
    		}
    	}
    }
    
    // check column order after migration, flaky test
    // https://github.com/go-gorm/gorm/issues/4351
    func TestMigrateColumnOrder(t *testing.T) {
    	type UserMigrateColumn struct {
    		ID uint
    	}
    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)
  6. migrator/migrator.go

    	var (
    		alterColumn bool
    		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
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  7. callbacks/associations.go

    	}
    
    	if len(omits) > 0 {
    		tx = tx.Omit(omits...)
    	}
    
    	return db.AddError(tx.Create(values).Error)
    }
    
    // check association values has been saved
    // if values kind is Struct, check it has been saved
    // if values kind is Slice/Array, check all items have been saved
    var visitMapStoreKey = "gorm:saved_association_map"
    
    func checkAssociationsSaved(db *gorm.DB, values reflect.Value) bool {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  8. utils/utils.go

    		}
    	}
    
    	return ""
    }
    
    func IsValidDBNameChar(c rune) bool {
    	return !unicode.IsLetter(c) && !unicode.IsNumber(c) && c != '.' && c != '*' && c != '_' && c != '$' && c != '@'
    }
    
    // CheckTruth check string true or not
    func CheckTruth(vals ...string) bool {
    	for _, val := range vals {
    		if val != "" && !strings.EqualFold(val, "false") {
    			return true
    		}
    	}
    	return false
    }
    
    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)
  9. tests/postgres_test.go

    	}
    }
    
    func TestPostgres(t *testing.T) {
    	if DB.Dialector.Name() != "postgres" {
    		t.Skip()
    	}
    
    	type Harumph struct {
    		gorm.Model
    		Name      string         `gorm:"check:name_checker,name <> ''"`
    		Test      uuid.UUID      `gorm:"type:uuid;not null;default:gen_random_uuid()"`
    		CreatedAt time.Time      `gorm:"type:TIMESTAMP WITHOUT TIME ZONE"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  10. schema/schema_test.go

    		t.Fatalf("failed to parse pointer user, got error %v", err)
    	}
    
    	checkUserSchema(t, user)
    }
    
    func checkUserSchema(t *testing.T, user *schema.Schema) {
    	// check schema
    	checkSchema(t, user, schema.Schema{Name: "User", Table: "users"}, []string{"ID"})
    
    	// check fields
    	fields := []schema.Field{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
Back to top