Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for creation (0.25 sec)

  1. schema/schema_helper_test.go

    func checkSchemaRelation(t *testing.T, s *schema.Schema, relation Relation) {
    	t.Run("CheckRelation/"+relation.Name, func(t *testing.T) {
    		if r, ok := s.Relationships.Relations[relation.Name]; ok {
    			if r.Name != relation.Name {
    				t.Errorf("schema %v relation name expects %v, but got %v", s, r.Name, relation.Name)
    			}
    
    			if r.Type != relation.Type {
    				t.Errorf("schema %v relation name expects %v, but got %v", s, r.Type, relation.Type)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  2. schema/naming.go

    		return ns.TablePrefix + str
    	}
    
    	if ns.SingularTable {
    		return ns.TablePrefix + ns.toDBName(str)
    	}
    	return ns.TablePrefix + inflection.Plural(ns.toDBName(str))
    }
    
    // RelationshipFKName generate fk name for relation
    func (ns NamingStrategy) RelationshipFKName(rel Relationship) string {
    	return ns.formatName("fk", rel.Schema.Table, ns.toDBName(rel.Name))
    }
    
    // CheckerName generate checker name
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  3. tests/postgres_test.go

    		Data:    "something else",
    	}
    
    	result := DB.Clauses(clause.OnConflict{
    		OnConstraint: "some_id_other_id_unique",
    		UpdateAll:    true,
    	}).Create(&thing2)
    	if result.Error != nil {
    		t.Errorf("creating second thing: %v", result.Error)
    	}
    
    	var things []Thing
    	if err := DB.Find(&things).Error; err != nil {
    		t.Errorf("Failed, got error: %v", err)
    	}
    
    	if len(things) > 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  4. tests/gorm_test.go

    		} else if results.RowsAffected != 1 {
    			t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected)
    		}
    
    		u1 = user{} // important to reinitialize this before creating it again
    		u2 := user{}
    		db := DB.Session(&gorm.Session{CreateBatchSize: 10})
    
    		if results := db.Create([]*user{&u1, &u2}); results.Error != nil {
    			t.Fatalf("errors happened on create: %v", results.Error)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  5. clause/select.go

    package clause
    
    // Select select attrs when querying, updating, creating
    type Select struct {
    	Distinct   bool
    	Columns    []Column
    	Expression Expression
    }
    
    func (s Select) Name() string {
    	return "SELECT"
    }
    
    func (s Select) Build(builder Builder) {
    	if len(s.Columns) > 0 {
    		if s.Distinct {
    			builder.WriteString("DISTINCT ")
    		}
    
    		for idx, column := range s.Columns {
    			if idx > 0 {
    				builder.WriteByte(',')
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 14 07:51:24 GMT 2021
    - 1.1K bytes
    - Viewed (0)
  6. prepare_stmt.go

    	db.Stmts[query] = &cacheStmt
    	db.Mux.Unlock()
    
    	// prepare completed
    	defer close(cacheStmt.prepared)
    
    	// Reason why cannot lock conn.PrepareContext
    	// suppose the maxopen is 1, g1 is creating record and g2 is querying record.
    	// 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
Back to top