Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for dbName (0.17 sec)

  1. callbacks/query.go

    										Value:  clause.Column{Table: tableAliasName, Name: ref.ForeignKey.DBName},
    									}
    								} else {
    									if ref.PrimaryValue == "" {
    										exprs[idx] = clause.Eq{
    											Column: clause.Column{Table: parentTableName, Name: ref.ForeignKey.DBName},
    											Value:  clause.Column{Table: tableAliasName, Name: ref.PrimaryKey.DBName},
    										}
    									} else {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  2. callbacks/create.go

    			}
    
    			for _, field := range stmt.Schema.FieldsWithDefaultDBValue {
    				if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) && field.DefaultValueInterface == nil {
    					if rvOfvalue, isZero := field.ValueOf(stmt.Context, stmt.ReflectValue); !isZero {
    						values.Columns = append(values.Columns, clause.Column{Name: field.DBName})
    						values.Values[0] = append(values.Values[0], rvOfvalue)
    					}
    				}
    			}
    		default:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  3. schema/constraint.go

    }
    
    // ParseUniqueConstraints parse schema unique constraints
    func (schema *Schema) ParseUniqueConstraints() map[string]UniqueConstraint {
    	uniques := make(map[string]UniqueConstraint)
    	for _, field := range schema.Fields {
    		if field.Unique {
    			name := schema.namer.UniqueName(schema.Table, field.DBName)
    			uniques[name] = UniqueConstraint{Name: name, Field: field}
    		}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  4. callbacks/update.go

    			}
    		}
    
    		if !stmt.SkipHooks && stmt.Schema != nil {
    			for _, dbName := range stmt.Schema.DBNames {
    				field := stmt.Schema.LookUpField(dbName)
    				if field.AutoUpdateTime > 0 && value[field.Name] == nil && value[field.DBName] == nil {
    					if v, ok := selectColumns[field.DBName]; (ok && v) || !ok {
    						now := stmt.DB.NowFunc()
    						assignValue(field, now)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  5. schema/schema_helper_test.go

    			if f.DBName != "" {
    				if field, ok := s.FieldsByDBName[f.DBName]; !ok || parsedField != field {
    					t.Errorf("schema %v failed to look up field with dbname %v", s, f.DBName)
    				}
    			}
    
    			for _, name := range []string{f.DBName, f.Name} {
    				if name != "" {
    					if field := s.LookUpField(name); field == nil || (field.Name != name && field.DBName != name) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. migrator/migrator.go

    				)
    				for _, dbName := range stmt.Schema.DBNames {
    					var foundColumn gorm.ColumnType
    
    					for _, columnType := range columnTypes {
    						if columnType.Name() == dbName {
    							foundColumn = columnType
    							break
    						}
    					}
    
    					if foundColumn == nil {
    						// not found, add column
    						if err = execTx.Migrator().AddColumn(value, dbName); err != nil {
    							return err
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  7. schema/schema_test.go

    		{Name: "DeletedAt", DBName: "deleted_at", BindNames: []string{"Model", "DeletedAt"}, Tag: `gorm:"index"`, DataType: schema.Time},
    		{Name: "Name", DBName: "name", BindNames: []string{"Name"}, DataType: schema.String},
    		{Name: "Age", DBName: "age", BindNames: []string{"Age"}, DataType: schema.Uint, Size: 64},
    		{Name: "Birthday", DBName: "birthday", BindNames: []string{"Birthday"}, DataType: schema.Time},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  8. scan.go

    								rel = rel.FieldSchema.Relationships.Relations[name]
    								relFields = append(relFields, rel.Field)
    							}
    							// lastest name is raw dbname
    							dbName := names[subNameCount-1]
    							if field := rel.FieldSchema.LookUpField(dbName); field != nil && field.Readable {
    								fields[idx] = field
    
    								if len(joinFields) == 0 {
    									joinFields = make([][]*schema.Field, len(columns))
    								}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  9. schema/field_test.go

    	}
    
    	fields := []*schema.Field{
    		{Name: "ID", DBName: "id", BindNames: []string{"ID"}, DataType: schema.Uint, PrimaryKey: true, Size: 64, Creatable: true, Updatable: true, Readable: true, HasDefaultValue: true, AutoIncrement: true},
    		{Name: "Name", DBName: "", BindNames: []string{"Name"}, DataType: "", Tag: `gorm:"-"`, Creatable: false, Updatable: false, Readable: false},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  10. statement.go

    			notRestricted = result
    			for _, dbName := range stmt.Schema.DBNames {
    				results[dbName] = result
    			}
    		} else if column == clause.Associations {
    			for _, rel := range stmt.Schema.Relationships.Relations {
    				results[rel.Name] = result
    			}
    		} else if field := stmt.Schema.LookUpField(column); field != nil && field.DBName != "" {
    			results[field.DBName] = result
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
Back to top