Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for intro (5.4 sec)

  1. scan.go

    // scan modes
    const (
    	ScanInitialized         ScanMode = 1 << 0 // 1
    	ScanUpdate              ScanMode = 1 << 1 // 2
    	ScanOnConflictDoNothing ScanMode = 1 << 2 // 4
    )
    
    // Scan scan rows into db statement
    func Scan(rows Rows, db *DB, mode ScanMode) {
    	var (
    		columns, _          = rows.Columns()
    		values              = make([]interface{}, len(columns))
    		initialized         = mode&ScanInitialized != 0
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  2. tests/create_test.go

    			"user_id": gorm.Expr("(?)", DB.Table("(?) as tmp", subQuery).Select("@uid:=id")),
    		},
    		{
    			"name":    "dog",
    			"user_id": gorm.Expr("@uid"),
    		},
    	})
    
    	if !regexp.MustCompile(`INSERT INTO .pets. \(.name.,.user_id.\) .*VALUES \(.+,\(SELECT @uid:=id FROM \(SELECT id FROM .users. WHERE name=.+\) as tmp\)\),\(.+,@uid\)`).MatchString(result.Statement.SQL.String()) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  3. chainable_api.go

    // Limit specify the number of records to be retrieved
    //
    // Limit conditions can be cancelled by using `Limit(-1)`.
    //
    //	// retrieve 3 users
    //	db.Limit(3).Find(&users)
    //	// retrieve 3 users into users1, and all users into users2
    //	db.Limit(3).Find(&users1).Limit(-1).Find(&users2)
    func (db *DB) Limit(limit int) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.AddClause(clause.Limit{Limit: &limit})
    	return
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. tests/upsert_test.go

    		}
    
    		r := DB.Session(&gorm.Session{DryRun: true}).Clauses(clause.OnConflict{UpdateAll: true}).Create(&RestrictedLanguage{Code: "upsert_code", Name: "upsert_name", Lang: "upsert_lang"})
    		if !regexp.MustCompile(`INTO .restricted_languages. .*\(.code.,.name.,.lang.\) .* (SET|UPDATE) .name.=.*.name.\W*$`).MatchString(r.Statement.SQL.String()) {
    			t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    		}
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  5. tests/table_test.go

    	r = dryDB.Create(&UserWithTable{}).Statement
    	if DB.Dialector.Name() != "sqlite" {
    		if !regexp.MustCompile(`INSERT INTO .gorm.\..user. (.*name.*) VALUES (.*)`).MatchString(r.Statement.SQL.String()) {
    			t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    		}
    	} else {
    		if !regexp.MustCompile(`INSERT INTO .user. (.*name.*) VALUES (.*)`).MatchString(r.Statement.SQL.String()) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  6. tests/scanner_valuer_test.go

    		Point: Point{X: 100, Y: 100},
    	}).Statement
    
    	if stmt.SQL.String() == "" || len(stmt.Vars) != 2 {
    		t.Errorf("Failed to generate sql, got %v", stmt.SQL.String())
    	}
    
    	if !regexp.MustCompile(`INSERT INTO .user_with_points. \(.name.,.point.\) VALUES \(.+,ST_PointFromText\(.+\)\)`).MatchString(stmt.SQL.String()) {
    		t.Errorf("insert with sql.Expr, but got %v", stmt.SQL.String())
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  7. tests/sql_builder_test.go

    		t.Fatalf("\nexpected: %s\nactually: %s", expected, actually)
    	}
    }
    
    func replaceQuoteInSQL(sql string) string {
    	// convert single quote into double quote
    	sql = strings.ReplaceAll(sql, `'`, `"`)
    
    	// convert dialect special quote into double quote
    	switch DB.Dialector.Name() {
    	case "postgres":
    		sql = strings.ReplaceAll(sql, `"`, `"`)
    	case "mysql", "sqlite":
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  8. gorm.go

    }
    
    // Debug start debug mode
    func (db *DB) Debug() (tx *DB) {
    	tx = db.getInstance()
    	return tx.Session(&Session{
    		Logger: db.Logger.LogMode(logger.Info),
    	})
    }
    
    // Set store value with key into current db instance's context
    func (db *DB) Set(key string, value interface{}) *DB {
    	tx := db.getInstance()
    	tx.Statement.Settings.Store(key, value)
    	return tx
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
Back to top