Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 63 for uniqBy (0.19 sec)

  1. schema/index_test.go

    		FieldF2 string `gorm:"uniqueIndex:uniq_field_f1_f2;"`
    
    		FieldG string `gorm:"unique;uniqueIndex"` // unique and uniqueIndex
    
    		FieldH1 string `gorm:"unique;uniqueIndex:uniq_field_h1_h2"` // unique and mul uniqueIndex
    		FieldH2 string `gorm:"uniqueIndex:uniq_field_h1_h2"`        // unique and mul uniqueIndex
    	}
    	indexSchema, err := schema.Parse(&IndexTest{}, &sync.Map{}, schema.NamingStrategy{})
    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. schema/constraint_test.go

    			Name:  "uni_user_uniques_name1",
    			Field: &schema.Field{Name: "Name1", Unique: true},
    		},
    	}
    	for k, result := range results {
    		v, ok := constraints[k]
    		if !ok {
    			t.Errorf("Failed to found unique constraint %v from parsed constraints %+v", k, constraints)
    		}
    		tests.AssertObjEqual(t, result, v, "Name")
    		tests.AssertObjEqual(t, result.Field, v.Field, "Name", "Unique", "UniqueIndex")
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  3. tests/default_value_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    )
    
    func TestDefaultValue(t *testing.T) {
    	type Harumph struct {
    		gorm.Model
    		Email   string    `gorm:"not null;index:,unique"`
    		Name    string    `gorm:"notNull;default:foo"`
    		Name2   string    `gorm:"size:233;not null;default:'foo'"`
    		Name3   string    `gorm:"size:233;notNull;default:''"`
    		Age     int       `gorm:"default:18"`
    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)
  4. cmd/storage-interface.go

    	// Returns the entire endpoint.
    	Endpoint() Endpoint
    
    	// Close the disk, mark it purposefully closed, only implemented for remote disks.
    	Close() error
    
    	// Returns the unique 'uuid' of this disk.
    	GetDiskID() (string, error)
    
    	// Set a unique 'uuid' for this disk, only used when
    	// disk is replaced and formatted.
    	SetDiskID(id string)
    
    	// Returns healing information for a newly replaced disk,
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  5. internal/bucket/lifecycle/lifecycle.go

    	}
    	return false
    }
    
    // ParseLifecycleConfigWithID - parses for a Lifecycle config and assigns
    // unique id to rules with empty ID.
    func ParseLifecycleConfigWithID(r io.Reader) (*Lifecycle, error) {
    	var lc Lifecycle
    	if err := xml.NewDecoder(r).Decode(&lc); err != nil {
    		return nil, err
    	}
    	// assign a unique id for rules with empty ID
    	for i := range lc.Rules {
    		if lc.Rules[i].ID == "" {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 06:41:22 GMT 2024
    - 17K bytes
    - Viewed (0)
  6. schema/field.go

    	Serializer             SerializerInterface
    	NewValuePool           FieldNewValuePool
    
    	// In some db (e.g. MySQL), Unique and UniqueIndex are indistinguishable.
    	// When a column has a (not Mul) UniqueIndex, Migrator always reports its gorm.ColumnType is Unique.
    	// It causes field unnecessarily migration.
    	// Therefore, we need to record the UniqueIndex on this column (exclude Mul UniqueIndex) for MigrateColumnUnique.
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  7. cmd/erasure-multipart.go

    		ChecksumAlgo: userDefined[hash.MinIOMultipartChecksum],
    	}, nil
    }
    
    // NewMultipartUpload - initialize a new multipart upload, returns a
    // unique id. The unique id returned here is of UUID form, for each
    // subsequent request each UUID is unique.
    //
    // Implements S3 compatible initiate multipart API.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 43K bytes
    - Viewed (0)
  8. internal/logger/logger.go

    	errorFmtFunc = f
    }
    
    // uniq swaps away duplicate elements in data, returning the size of the
    // unique set. data is expected to be pre-sorted, and the resulting set in
    // the range [0:size] will remain in sorted order. Uniq, following a
    // sort.Sort call, can be used to prepare arbitrary inputs for use as sets.
    func uniq(data sort.Interface) (size int) {
    	p, l := 0, data.Len()
    	if l <= 1 {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 12.2K bytes
    - Viewed (0)
  9. tests/error_translator_test.go

    func TestSupportedDialectorWithErrForeignKeyViolated(t *testing.T) {
    	tidbSkip(t, "not support the foreign key feature")
    
    	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"`
    	}
    
    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)
  10. schema/relationship.go

    			PkgPath: ownField.StructField.PkgPath,
    			Type:    ownField.StructField.Type,
    			Tag: removeSettingFromTag(appendSettingFromTag(ownField.StructField.Tag, "primaryKey"),
    				"column", "autoincrement", "index", "unique", "uniqueindex"),
    		})
    	}
    
    	for idx, relField := range refForeignFields {
    		joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name
    
    		if _, ok := ownFieldsMap[joinFieldName]; ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
Back to top