Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 60 for nmap (0.21 sec)

  1. schema/utils.go

    	}
    
    	return
    }
    
    // GetIdentityFieldValuesMap get identity map from fields
    func GetIdentityFieldValuesMap(ctx context.Context, reflectValue reflect.Value, fields []*Field) (map[string][]reflect.Value, [][]interface{}) {
    	var (
    		results       = [][]interface{}{}
    		dataResults   = map[string][]reflect.Value{}
    		loaded        = map[interface{}]bool{}
    		notZero, zero bool
    	)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  2. tests/update_test.go

    	lastUpdatedAt := users[0].UpdatedAt
    
    	// update with map
    	if res := DB.Model(users[0]).Updates(map[string]interface{}{"name": "updates_01_newname", "age": 100}); res.Error != nil || res.RowsAffected != 1 {
    		t.Errorf("Failed to update users")
    	}
    
    	if users[0].Name != "updates_01_newname" || users[0].Age != 100 {
    		t.Errorf("Record should be updated also with map")
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. schema/index_test.go

    	Data2B string `gorm:"index:,unique,composite:comp_id2,priority:3"`
    }
    
    func TestParseIndex(t *testing.T) {
    	user, err := schema.Parse(&UserIndex{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse user index, got error %v", err)
    	}
    
    	results := map[string]schema.Index{
    		"idx_user_indices_name": {
    			Name:   "idx_user_indices_name",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "Name"}}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  4. prepare_stmt.go

    	prepared    chan struct{}
    	prepareErr  error
    }
    
    type PreparedStmtDB struct {
    	Stmts       map[string]*Stmt
    	PreparedSQL []string
    	Mux         *sync.RWMutex
    	ConnPool
    }
    
    func NewPreparedStmtDB(connPool ConnPool) *PreparedStmtDB {
    	return &PreparedStmtDB{
    		ConnPool:    connPool,
    		Stmts:       make(map[string]*Stmt),
    		Mux:         &sync.RWMutex{},
    		PreparedSQL: make([]string, 0, 100),
    	}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  5. schema/index.go

    	*Field
    	Expression string
    	Sort       string // DESC, ASC
    	Collate    string
    	Length     int
    	priority   int
    }
    
    // ParseIndexes parse schema indexes
    func (schema *Schema) ParseIndexes() map[string]Index {
    	indexes := map[string]Index{}
    
    	for _, field := range schema.Fields {
    		if field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUEINDEX"] != "" {
    			fieldIndexes, err := parseFieldIndexes(field)
    			if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  6. schema/callbacks_test.go

    	return nil
    }
    
    func (UserWithCallback) AfterCreate(*gorm.DB) error {
    	return nil
    }
    
    func TestCallback(t *testing.T) {
    	user, err := schema.Parse(&UserWithCallback{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse user with callback, got error %v", err)
    	}
    
    	for _, str := range []string{"BeforeSave", "AfterCreate"} {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  7. tests/scanner_valuer_test.go

    	}
    
    	if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) {
    		t.Errorf("generated vars is not equal, got %v", stmt.Vars)
    	}
    
    	stmt = dryRunDB.Model(UserWithPoint{}).Create(map[string]interface{}{
    		"Name":  "jinzhu",
    		"Point": clause.Expr{SQL: "ST_PointFromText(?)", Vars: []interface{}{"POINT(100 100)"}},
    	}).Statement
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  8. tests/scan_test.go

    		return strings.Compare(results[i].Name, results[j].Name) <= -1
    	})
    
    	if len(results) != 2 || results[0].Name != user2.Name || results[1].Name != user3.Name {
    		t.Errorf("Scan into struct map, got %#v", results)
    	}
    
    	type ID uint64
    	var id ID
    	DB.Raw("select id from users where id = ?", user2.ID).Scan(&id)
    	if uint(id) != user2.ID {
    		t.Errorf("Failed to scan to customized data type")
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  9. clause/benchmarks_test.go

    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    func BenchmarkSelect(b *testing.B) {
    	user, _ := schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy)
    
    	for i := 0; i < b.N; i++ {
    		stmt := gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Oct 07 12:14:14 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  10. schema/schema_helper_test.go

    		}
    	})
    }
    
    type EmbeddedRelations struct {
    	Relations         map[string]Relation
    	EmbeddedRelations map[string]EmbeddedRelations
    }
    
    func checkEmbeddedRelations(t *testing.T, actual map[string]*schema.Relationships, expected map[string]EmbeddedRelations) {
    	for name, relations := range actual {
    		rs := expected[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)
Back to top