Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Trello (0.21 sec)

  1. schema/index_test.go

    	Name4        string `gorm:"uniqueIndex"`
    	Name5        int64  `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
    	Name6        int64  `gorm:"index:profile,comment:hello \\, world,where:age > 10"`
    	Age          int64  `gorm:"index:profile,expression:ABS(age),option:WITH PARSER parser_name"`
    	OID          int64  `gorm:"index:idx_id;index:idx_oid,unique"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. chainable_api.go

    )
    
    // Model specify the model you would like to run db operations
    //
    //	// update all users's name to `hello`
    //	db.Model(&User{}).Update("name", "hello")
    //	// if user's primary key is non-blank, will use it as condition, then will only update that user's name to `hello`
    //	db.Model(&user).Update("name", "hello")
    func (db *DB) Model(value interface{}) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.Model = value
    	return
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. tests/postgres_test.go

    		t.Fatalf("Failed to create 'uuid-ossp' extension, but got error %v", err)
    	}
    
    	DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories")
    	DB.AutoMigrate(&Post{}, &Category{})
    
    	post := Post{
    		Title: "Hello World",
    		Categories: []*Category{
    			{Title: "Coding"},
    			{Title: "Golang"},
    		},
    	}
    
    	if err := DB.Create(&post).Error; err != nil {
    		t.Errorf("Failed, got error: %v", err)
    	}
    }
    
    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)
  4. tests/serializer_test.go

    		*es = EncryptedString(bytes.TrimPrefix(value, []byte("hello")))
    	case string:
    		*es = EncryptedString(strings.TrimPrefix(value, "hello"))
    	default:
    		return fmt.Errorf("unsupported data %#v", dbValue)
    	}
    	return nil
    }
    
    func (es EncryptedString) Value(ctx context.Context, field *schema.Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
    	return "hello" + string(es), nil
    }
    
    type CustomSerializer struct {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  5. tests/default_value_test.go

    	}
    
    	DB.Migrator().DropTable(&Harumph{})
    
    	if err := DB.AutoMigrate(&Harumph{}); err != nil {
    		t.Fatalf("Failed to migrate with default value, got error: %v", err)
    	}
    
    	harumph := Harumph{Email: "hello@gorm.io"}
    	if err := DB.Create(&harumph).Error; err != nil {
    		t.Fatalf("Failed to create data with default value, got error: %v", err)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  6. tests/embedded_struct_test.go

    	}
    
    	DB.Migrator().DropTable(&HNPost{})
    	if err := DB.Migrator().AutoMigrate(&HNPost{}); err != nil {
    		t.Fatalf("failed to auto migrate, got error: %v", err)
    	}
    
    	hnPost := HNPost{Content: Content{Content: "hello world"}}
    
    	if err := DB.Create(&hnPost).Error; err != nil {
    		t.Errorf("Failed to create got error %v", err)
    	}
    }
    
    func TestEmbeddedRelations(t *testing.T) {
    	type EmbUser struct {
    		gorm.Model
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  7. tests/main_test.go

    	}
    
    	DB.Model(&User{}).Count(&count2)
    	if count1 != count2 {
    		t.Errorf("No user should not be deleted by invalid SQL")
    	}
    }
    
    func TestSetAndGet(t *testing.T) {
    	if value, ok := DB.Set("hello", "world").Get("hello"); !ok {
    		t.Errorf("Should be able to get setting after set")
    	} else if value.(string) != "world" {
    		t.Errorf("Set value should not be changed")
    	}
    
    	if _, ok := DB.Get("non_existing"); ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  8. tests/migrate_test.go

    	}
    
    	type ColumnStruct2 struct {
    		ID    int    `gorm:"primarykey;default:auto_random()"`
    		Name  string `gorm:"size:100"`
    		Code  string `gorm:"unique;comment:my code2;default:hello"`
    		Code2 string `gorm:"comment:my code2;default:hello"`
    	}
    
    	if err := DB.Table("column_structs").Migrator().AlterColumn(&ColumnStruct{}, "Name"); err != nil {
    		t.Fatalf("no error should happened when alter column, but got %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top