Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 513 for constraint (0.22 sec)

  1. schema/interfaces.go

    package schema
    
    import (
    	"gorm.io/gorm/clause"
    )
    
    // ConstraintInterface database constraint interface
    type ConstraintInterface interface {
    	GetName() string
    	Build() (sql string, vars []interface{})
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    	GormDataType() string
    }
    
    // FieldNewValuePool field new scan value pool
    type FieldNewValuePool interface {
    	Get() interface{}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  2. tests/postgres_test.go

    		gorm.Model
    		SomeID  string
    		OtherID string
    		Data    string
    	}
    
    	DB.Migrator().DropTable(&Thing{})
    	DB.Migrator().CreateTable(&Thing{})
    	if err := DB.Exec("ALTER TABLE things ADD CONSTRAINT some_id_other_id_unique UNIQUE (some_id, other_id)").Error; err != nil {
    		t.Error(err)
    	}
    
    	thing := Thing{
    		SomeID:  "1234",
    		OtherID: "1234",
    		Data:    "something",
    	}
    
    	DB.Create(&thing)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  3. tests/associations_test.go

    		Name    string
    		Profile Profile `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:MemberID;References:Refer"`
    	}
    
    	DB.Migrator().DropTable(&Profile{}, &Member{})
    
    	if err := DB.AutoMigrate(&Profile{}, &Member{}); err != nil {
    		t.Fatalf("Failed to migrate, got error: %v", err)
    	}
    
    	member := Member{Refer: 1, Name: "foreign_key_constraints", Profile: Profile{Name: "my_profile"}}
    
    	DB.Create(&member)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  4. schema/relationship_test.go

    	}
    
    	expectedConstraintName := "fk_my_schema_a_very_very_very_very_very_very_very_very_l4db13eec"
    	constraint := s.Relationships.Relations["Author"].ParseConstraint()
    
    	if constraint.Name != expectedConstraintName {
    		t.Fatalf(
    			"expected constraint name %s, got %s",
    			expectedConstraintName,
    			constraint.Name,
    		)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  5. tests/multi_primary_keys_test.go

    		stmt := gorm.Statement{DB: DB}
    		stmt.Parse(&Blog{})
    		stmt.Schema.LookUpField("ID").Unique = true
    		stmt.Parse(&Tag{})
    		stmt.Schema.LookUpField("ID").Unique = true
    		// postgers only allow unique constraint matching given keys
    	}
    
    	DB.Migrator().DropTable(&Blog{}, &Tag{}, "blog_tags", "locale_blog_tags", "shared_blog_tags")
    	if err := DB.AutoMigrate(&Blog{}, &Tag{}); err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/MutableClassToInstanceMap.java

      }
    
      @Override
      protected Map<Class<? extends @NonNull B>, B> delegate() {
        return delegate;
      }
    
      /**
       * Wraps the {@code setValue} implementation of an {@code Entry} to enforce the class constraint.
       */
      private static <B extends @Nullable Object> Entry<Class<? extends @NonNull B>, B> checkedEntry(
          final Entry<Class<? extends @NonNull B>, B> entry) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  7. migrator.go

    	DropColumn(dst interface{}, field string) error
    	AlterColumn(dst interface{}, field string) error
    	MigrateColumn(dst interface{}, field *schema.Field, columnType ColumnType) error
    	// MigrateColumnUnique migrate column's UNIQUE constraint, it's part of MigrateColumn.
    	MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error
    	HasColumn(dst interface{}, field string) bool
    	RenameColumn(dst interface{}, oldName, field string) error
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  8. tests/error_translator_test.go

    	type City struct {
    		gorm.Model
    		Name string `gorm:"unique"`
    	}
    
    	type Museum struct {
    		gorm.Model
    		Name   string `gorm:"unique"`
    		CityID uint
    		City   City `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:CityID;References:ID"`
    	}
    
    	db, err := OpenTestConnection(&gorm.Config{TranslateError: true})
    	if err != nil {
    		t.Fatalf("failed to connect database, got error %v", err)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 12 13:21:22 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  9. docs/en/docs/history-design-future.md

    Then I contributed to it, to make it fully compliant with JSON Schema, to support different ways to define constraint declarations, and to improve editor support (type checks, autocompletion) based on the tests in several editors.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/BiMap.java

    import javax.annotation.CheckForNull;
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /**
     * A bimap (or "bidirectional map") is a map that preserves the uniqueness of its values as well as
     * that of its keys. This constraint enables bimaps to support an "inverse view", which is another
     * bimap containing the same entries as this bimap but with reversed keys and values.
     *
     * <h3>Implementations</h3>
     *
     * <ul>
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Sat Jun 17 14:40:53 GMT 2023
    - 4.3K bytes
    - Viewed (0)
Back to top