Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 42 for primary_key (0.62 sec)

  1. clause/clause.go

    			c.AfterExpression.Build(builder)
    		}
    	}
    }
    
    const (
    	PrimaryKey   string = "~~~py~~~" // primary key
    	CurrentTable string = "~~~ct~~~" // current table
    	Associations string = "~~~as~~~" // associations
    )
    
    var (
    	currentTable  = Table{Name: CurrentTable}
    	PrimaryColumn = Column{Table: CurrentTable, Name: PrimaryKey}
    )
    
    // Column quote with name
    type Column struct {
    	Table string
    	Name  string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Feb 02 09:15:08 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. migrator/index.go

    func (idx Index) Name() string {
    	return idx.NameValue
    }
    
    // Columns return the columns of the index
    func (idx Index) Columns() []string {
    	return idx.ColumnList
    }
    
    // PrimaryKey returns the index is primary key or not.
    func (idx Index) PrimaryKey() (isPrimaryKey bool, ok bool) {
    	return idx.PrimaryKeyValue.Bool, idx.PrimaryKeyValue.Valid
    }
    
    // Unique returns whether the index is unique or not.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 02:32:46 GMT 2023
    - 1023 bytes
    - Viewed (0)
  3. clause/set.go

    			}
    			builder.WriteQuoted(assignment.Column)
    			builder.WriteByte('=')
    			builder.AddVar(builder, assignment.Value)
    		}
    	} else {
    		builder.WriteQuoted(Column{Name: PrimaryKey})
    		builder.WriteByte('=')
    		builder.WriteQuoted(Column{Name: PrimaryKey})
    	}
    }
    
    // MergeClause merge assignments clauses
    func (set Set) MergeClause(clause *Clause) {
    	copiedAssignments := make([]Assignment, len(set))
    	copy(copiedAssignments, set)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Nov 29 03:02:44 GMT 2021
    - 1.4K bytes
    - Viewed (0)
  4. callbacks/associations.go

    						if ref.OwnPrimaryKey {
    							fv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, obj)
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, joinValue, fv))
    						} else if ref.PrimaryValue != "" {
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, joinValue, ref.PrimaryValue))
    						} else {
    							fv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, elem)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  5. migrator.go

    }
    
    // ColumnType column type interface
    type ColumnType interface {
    	Name() string
    	DatabaseTypeName() string                 // varchar
    	ColumnType() (columnType string, ok bool) // varchar(64)
    	PrimaryKey() (isPrimaryKey bool, ok bool)
    	AutoIncrement() (isAutoIncrement bool, ok bool)
    	Length() (length int64, ok bool)
    	DecimalSize() (precision int64, scale int64, ok bool)
    	Nullable() (nullable bool, ok bool)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  6. migrator/column_type.go

    func (ct ColumnType) ColumnType() (columnType string, ok bool) {
    	return ct.ColumnTypeValue.String, ct.ColumnTypeValue.Valid
    }
    
    // PrimaryKey returns the column is primary key or not.
    func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) {
    	return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid
    }
    
    // AutoIncrement returns the column is auto increment or not.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  7. callbacks/preload.go

    				foreignFields = append(foreignFields, ref.PrimaryKey)
    			} else if ref.PrimaryValue != "" {
    				tx = tx.Where(clause.Eq{Column: ref.ForeignKey.DBName, Value: ref.PrimaryValue})
    			} else {
    				joinRelForeignFields = append(joinRelForeignFields, ref.ForeignKey)
    				relForeignKeys = append(relForeignKeys, ref.PrimaryKey.DBName)
    				relForeignFields = append(relForeignFields, ref.PrimaryKey)
    			}
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. association.go

    				if ref.PrimaryValue == "" {
    					if ref.OwnPrimaryKey {
    						primaryFields = append(primaryFields, ref.PrimaryKey)
    						joinPrimaryKeys = append(joinPrimaryKeys, ref.ForeignKey.DBName)
    					} else {
    						relPrimaryFields = append(relPrimaryFields, ref.PrimaryKey)
    						joinRelPrimaryKeys = append(joinRelPrimaryKeys, ref.ForeignKey.DBName)
    					}
    				} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  9. schema/schema.go

    				schema.FieldsByBindName[bindName] = field
    
    				if v != nil && v.PrimaryKey {
    					for idx, f := range schema.PrimaryFields {
    						if f == v {
    							schema.PrimaryFields = append(schema.PrimaryFields[0:idx], schema.PrimaryFields[idx+1:]...)
    						}
    					}
    				}
    
    				if field.PrimaryKey {
    					schema.PrimaryFields = append(schema.PrimaryFields, field)
    				}
    			}
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  10. model.go

    // It may be embedded into your model or you may build your own model without it
    //
    //	type User struct {
    //	  gorm.Model
    //	}
    type Model struct {
    	ID        uint `gorm:"primarykey"`
    	CreatedAt time.Time
    	UpdatedAt time.Time
    	DeletedAt DeletedAt `gorm:"index"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:06:43 GMT 2023
    - 396 bytes
    - Viewed (0)
Back to top