Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for row (0.14 sec)

  1. callbacks.go

    }
    
    func (cs *callbacks) Update() *processor {
    	return cs.processors["update"]
    }
    
    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 {
    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)
  2. tests/connpool_test.go

    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.QueryContext(ctx, query, args...)
    }
    
    func (c *wrapperTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.QueryRowContext(ctx, query, args...)
    }
    
    type wrapperConnPool struct {
    	db     *sql.DB
    	got    []string
    	expect []string
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		currentDatabase := m.DB.Migrator().CurrentDatabase()
    		return m.DB.Raw("SELECT count(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ? AND table_type = ?", currentDatabase, stmt.Table, "BASE TABLE").Row().Scan(&count)
    	})
    
    	return count > 0
    }
    
    // RenameTable rename table from oldName to newName
    func (m Migrator) RenameTable(oldName, newName interface{}) error {
    	var oldTable, newTable interface{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. finisher_api.go

    		*count = tx.RowsAffected
    	}
    
    	return
    }
    
    func (db *DB) Row() *sql.Row {
    	tx := db.getInstance().Set("rows", false)
    	tx = tx.callbacks.Row().Execute(tx)
    	row, ok := tx.Statement.Dest.(*sql.Row)
    	if !ok && tx.DryRun {
    		db.Logger.Error(tx.Statement.Context, ErrDryRunModeUnsupported.Error())
    	}
    	return row
    }
    
    func (db *DB) Rows() (*sql.Rows, error) {
    	tx := db.getInstance().Set("rows", true)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  5. prepare_stmt.go

    		}
    	}
    	return rows, err
    }
    
    func (db *PreparedStmtDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
    	stmt, err := db.prepare(ctx, db.ConnPool, false, query)
    	if err == nil {
    		return stmt.QueryRowContext(ctx, args...)
    	}
    	return &sql.Row{}
    }
    
    func (db *PreparedStmtDB) Ping() error {
    	conn, err := db.GetDBConn()
    	if err != nil {
    		return err
    	}
    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)
  6. tests/migrate_test.go

    	if err := DB.Order("id ASC").Find(&rows).Error; err != nil {
    		t.Fatalf("find auto_increment_struct fail, err: %v", err)
    	}
    
    	ids := make([]int64, 0, len(rows))
    	for _, row := range rows {
    		ids = append(ids, row.ID)
    	}
    	lastID := ids[len(ids)-1]
    
    	if err := DB.Where("id IN (?)", ids).Delete(&AutoIncrementStruct{}).Error; err != nil {
    		t.Fatalf("delete auto_increment_struct fail, err: %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  7. interfaces.go

    	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
    	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
    }
    
    // SavePointerDialectorInterface save pointer interface
    type SavePointerDialectorInterface interface {
    	SavePoint(tx *DB, name string) error
    	RollbackTo(tx *DB, name string) error
    }
    
    // TxBeginner tx beginner
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  8. tests/sql_builder_test.go

    	user3 := User{Name: "RowUser3", Age: 20}
    	DB.Save(&user1).Save(&user2).Save(&user3)
    
    	row := DB.Table("users").Where("name = ?", user2.Name).Select("age").Row()
    
    	var age int64
    	if err := row.Scan(&age); err != nil {
    		t.Fatalf("Failed to scan age, got %v", err)
    	}
    
    	if age != 10 {
    		t.Errorf("Scan with Row, age expects: %v, got %v", user2.Age, age)
    	}
    
    	table := "gorm.users"
    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)
  9. tests/query_test.go

    	rows, _ := DB.Table("users").Where("name = ?", "select_with_variables").Select("? as fake", gorm.Expr("name")).Rows()
    
    	if !rows.Next() {
    		t.Errorf("Should have returned at least one row")
    	} else {
    		columns, _ := rows.Columns()
    		AssertEqual(t, columns, []string{"fake"})
    	}
    
    	rows.Close()
    }
    
    func TestSelectWithArrayInput(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top