Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for colonne (0.36 sec)

  1. tests/hooks_test.go

    	gorm.Model
    	Name  string
    	Code  string
    	Price int64
    	Owner string
    }
    
    func (s Product2) BeforeCreate(tx *gorm.DB) (err error) {
    	if !strings.HasSuffix(s.Name, "_clone") {
    		newProduft := s
    		newProduft.Price *= 2
    		newProduft.Name += "_clone"
    		err = tx.Create(&newProduft).Error
    	}
    
    	if s.Name == "Invalid" {
    		return errors.New("invalid")
    	}
    
    	return nil
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  2. statement_test.go

    			s := new(Statement)
    			for w := 0; w < whereCount; w++ {
    				s = s.clone()
    				s.AddClause(clause.Where{
    					Exprs: s.BuildCondition(fmt.Sprintf("where%d", w)),
    				})
    			}
    
    			s1 := s.clone()
    			s1.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL1"),
    			})
    			s2 := s.clone()
    			s2.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL2"),
    			})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Dec 23 13:19:41 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  3. statement.go

    			stmt.TableExpr = &clause.Expr{SQL: stmt.Quote(stmt.Schema.Table)}
    			stmt.Table = tables[1]
    			return
    		}
    
    		stmt.Table = stmt.Schema.Table
    	}
    	return err
    }
    
    func (stmt *Statement) clone() *Statement {
    	newStmt := &Statement{
    		TableExpr:            stmt.TableExpr,
    		Table:                stmt.Table,
    		Model:                stmt.Model,
    		Unscoped:             stmt.Unscoped,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  4. gorm.go

    	if sqldb, ok := connPool.(*sql.DB); ok && sqldb != nil {
    		return sqldb, nil
    	}
    
    	return nil, ErrInvalidDB
    }
    
    func (db *DB) getInstance() *DB {
    	if db.clone > 0 {
    		tx := &DB{Config: db.Config, Error: db.Error}
    
    		if db.clone == 1 {
    			// clone with new statement
    			tx.Statement = &Statement{
    				DB:        tx,
    				ConnPool:  db.Statement.ConnPool,
    				Context:   db.Statement.Context,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  5. finisher_api.go

    	panicked = false
    	return
    }
    
    // Begin begins a transaction with any transaction options opts
    func (db *DB) Begin(opts ...*sql.TxOptions) *DB {
    	var (
    		// clone statement
    		tx  = db.getInstance().Session(&Session{Context: db.Statement.Context, NewDB: db.clone == 1})
    		opt *sql.TxOptions
    		err error
    	)
    
    	if len(opts) > 0 {
    		opt = opts[0]
    	}
    
    	switch beginner := tx.Statement.ConnPool.(type) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
Back to top