Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for Raw (0.11 sec)

  1. callbacks/raw.go

    heige <******@****.***> 1638149600 +0800
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Nov 29 01:33:20 GMT 2021
    - 336 bytes
    - Viewed (0)
  2. tests/benchmark_test.go

    	b.ResetTimer()
    	for x := 0; x < b.N; x++ {
    		DB.Raw("select * from users where id = ?", user.ID).Scan(&u)
    	}
    }
    
    func BenchmarkScanSlice(b *testing.B) {
    	DB.Exec("delete from users")
    	for i := 0; i < 10_000; i++ {
    		user := *GetUser(fmt.Sprintf("scan-%d", i), Config{})
    		DB.Create(&user)
    	}
    
    	var u []User
    	b.ResetTimer()
    	for x := 0; x < b.N; x++ {
    		DB.Raw("select * from users").Scan(&u)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 01 03:50:57 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  3. tests/named_argument_test.go

    	var result5 NamedUser
    	if err := DB.Raw("SELECT * FROM named_users WHERE (name1 = @name AND name3 = @name) AND name2 = @name2", map[string]interface{}{"name": "jinzhu-new", "name2": "jinzhu-new2"}).Find(&result5).Error; err != nil {
    		t.Errorf("failed to update with named arg")
    	}
    
    	AssertEqual(t, result5, namedUser)
    
    	var result6 NamedUser
    	if err := DB.Raw(`SELECT * FROM named_users WHERE (name1 = @name
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Dec 21 11:50:00 GMT 2021
    - 2.7K bytes
    - Viewed (0)
  4. callbacks.go

    }
    
    func (cs *callbacks) Delete() *processor {
    	return cs.processors["delete"]
    }
    
    func (cs *callbacks) Row() *processor {
    	return cs.processors["row"]
    }
    
    func (cs *callbacks) Raw() *processor {
    	return cs.processors["raw"]
    }
    
    func (p *processor) Execute(db *DB) *DB {
    	// call scopes
    	for len(db.Statement.scopes) > 0 {
    		db = db.executeScopes()
    	}
    
    	var (
    		curTime           = time.Now()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  5. scan.go

    			db.AddError(field.Set(db.Statement.Context, reflectValue, values[idx]))
    		} else { // joinFields count is larger than 2 when using join
    			var isNilPtrValue bool
    			var relValue reflect.Value
    			// does not contain raw dbname
    			nestedJoinSchemas := joinFields[idx][:len(joinFields[idx])-1]
    			// current reflect value
    			currentReflectValue := reflectValue
    			fullRels := make([]string, 0, len(nestedJoinSchemas))
    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)
  6. clause/expression.go

    // NegationExpressionBuilder negation expression builder
    type NegationExpressionBuilder interface {
    	NegationBuild(builder Builder)
    }
    
    // Expr raw expression
    type Expr struct {
    	SQL                string
    	Vars               []interface{}
    	WithoutParentheses bool
    }
    
    // Build build raw expression
    func (expr Expr) Build(builder Builder) {
    	var (
    		afterParenthesis bool
    		idx              int
    	)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  7. callbacks/query.go

    				if db.Statement.Schema == nil {
    					clauseSelect.Columns[idx] = clause.Column{Name: name, Raw: true}
    				} else if f := db.Statement.Schema.LookUpField(name); f != nil {
    					clauseSelect.Columns[idx] = clause.Column{Name: f.DBName}
    				} else {
    					clauseSelect.Columns[idx] = clause.Column{Name: name, Raw: true}
    				}
    			}
    		} else if db.Statement.Schema != nil && len(db.Statement.Omits) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  8. clause/clause.go

    	PrimaryColumn = Column{Table: CurrentTable, Name: PrimaryKey}
    )
    
    // Column quote with name
    type Column struct {
    	Table string
    	Name  string
    	Alias string
    	Raw   bool
    }
    
    // Table quote with name
    type Table struct {
    	Name  string
    	Alias string
    	Raw   bool
    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)
  9. migrator/migrator.go

    // For example, values that can pass this regular expression are:
    // - "123"
    // - "abc456"
    // -"%$#@789"
    var regFullDataType = regexp.MustCompile(`\D*(\d+)\D?`)
    
    // TODO:? Create const vars for raw sql queries ?
    
    var _ gorm.Migrator = (*Migrator)(nil)
    
    // Migrator m struct
    type Migrator struct {
    	Config
    }
    
    // Config schema config
    type Config struct {
    	CreateIndexAfterCreateTable bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  10. chainable_api.go

    func (db *DB) Group(name string) (tx *DB) {
    	tx = db.getInstance()
    
    	fields := strings.FieldsFunc(name, utils.IsValidDBNameChar)
    	tx.Statement.AddClause(clause.GroupBy{
    		Columns: []clause.Column{{Name: name, Raw: len(fields) != 1}},
    	})
    	return
    }
    
    // Having specify HAVING conditions for GROUP BY
    //
    //	// Select the sum age of users with name jinzhu
    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)
Back to top