Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for pause (0.03 sec)

  1. finisher_api.go

    			tx = tx.Clauses(clause.OnConflict{UpdateAll: true})
    		}
    		tx = tx.callbacks.Create().Execute(tx.Set("gorm:update_track_time", true))
    	case reflect.Struct:
    		if err := tx.Statement.Parse(value); err == nil && tx.Statement.Schema != nil {
    			for _, pf := range tx.Statement.Schema.PrimaryFields {
    				if _, isZero := pf.ValueOf(tx.Statement.Context, reflectValue); isZero {
    					return tx.callbacks.Create().Execute(tx)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Jan 12 08:42:21 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  2. gorm.go

    	var (
    		tx                      = db.getInstance()
    		stmt                    = tx.Statement
    		modelSchema, joinSchema *schema.Schema
    	)
    
    	err := stmt.Parse(model)
    	if err != nil {
    		return err
    	}
    	modelSchema = stmt.Schema
    
    	err = stmt.Parse(joinTable)
    	if err != nil {
    		return err
    	}
    	joinSchema = stmt.Schema
    
    	relation, ok := modelSchema.Relationships.Relations[field]
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Aug 20 11:46:56 UTC 2023
    - 11.6K bytes
    - Viewed (0)
  3. callbacks/query.go

    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    				stmt := gorm.Statement{DB: db}
    				// smaller struct
    				if err := stmt.Parse(db.Statement.Dest); err == nil && (db.QueryFields || stmt.Schema.ModelType != db.Statement.Schema.ModelType) {
    					clauseSelect.Columns = make([]clause.Column, len(stmt.Schema.DBNames))
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:51:44 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  4. schema/relationship.go

    		Name: cases.Title(language.Und, cases.NoLower).String(schema.Name) + field.Name,
    		Type: schema.ModelType,
    		Tag:  `gorm:"-"`,
    	})
    
    	if relation.JoinTable, err = Parse(reflect.New(reflect.StructOf(joinTableFields)).Interface(), schema.cacheStore,
    		schema.namer); err != nil {
    		schema.err = err
    	}
    	relation.JoinTable.Name = many2many
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  5. tests/table_test.go

    	}
    
    	t.Run("default", func(t *testing.T) {
    		db, _ := gorm.Open(postgres.Open(postgresDSN), &gorm.Config{})
    		user, err := schema.Parse(&LongString{}, &sync.Map{}, db.Config.NamingStrategy)
    		if err != nil {
    			t.Fatalf("failed to parse user unique, got error %v", err)
    		}
    
    		constraints := user.ParseUniqueConstraints()
    		if len(constraints) != 1 {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Mar 09 09:31:28 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  6. tests/multi_primary_keys_test.go

    	}
    
    	if name := DB.Dialector.Name(); name == "postgres" {
    		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
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 12.8K bytes
    - Viewed (0)
  7. migrator/migrator.go

    	} else {
    		stmt := &gorm.Statement{DB: m.DB}
    		if err := stmt.Parse(oldName); err == nil {
    			oldTable = m.CurrentTable(stmt)
    		} else {
    			return err
    		}
    	}
    
    	if v, ok := newName.(string); ok {
    		newTable = clause.Table{Name: v}
    	} else {
    		stmt := &gorm.Statement{DB: m.DB}
    		if err := stmt.Parse(newName); err == nil {
    			newTable = m.CurrentTable(stmt)
    		} else {
    			return err
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  8. schema/field_test.go

    	Name7 string `gorm:"->:false;<-:create,update"`
    	Name8 string `gorm:"->;-:migration"`
    }
    
    func TestParseFieldWithPermission(t *testing.T) {
    	user, err := schema.Parse(&UserWithPermissionControl{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("Failed to parse user with permission, got error %v", err)
    	}
    
    	fields := []*schema.Field{
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Feb 19 09:02:53 UTC 2022
    - 12.7K bytes
    - Viewed (0)
  9. association.go

    	Unscope      bool
    	Error        error
    }
    
    func (db *DB) Association(column string) *Association {
    	association := &Association{DB: db}
    	table := db.Statement.Table
    
    	if err := db.Statement.Parse(db.Statement.Model); err == nil {
    		db.Statement.Table = table
    		association.Relationship = db.Statement.Schema.Relationships.Relations[column]
    
    		if association.Relationship == nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  10. schema/schema_test.go

    func TestParseSchema(t *testing.T) {
    	user, err := schema.Parse(&tests.User{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse user, got error %v", err)
    	}
    
    	checkUserSchema(t, user)
    }
    
    func TestParseSchemaWithPointerFields(t *testing.T) {
    	user, err := schema.Parse(&User{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse pointer user, got error %v", err)
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Dec 15 08:31:23 UTC 2023
    - 12.9K bytes
    - Viewed (0)
Back to top