Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for CTX (0.14 sec)

  1. prepare_stmt.go

    		if errors.Is(err, driver.ErrBadConn) {
    			db.Mux.Lock()
    			defer db.Mux.Unlock()
    
    			go stmt.Close()
    			delete(db.Stmts, query)
    		}
    	}
    	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...)
    	}
    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)
  2. schema/utils.go

    func GetRelationsValues(ctx context.Context, reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) {
    	for _, rel := range rels {
    		reflectResults = reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.FieldSchema.ModelType)), 0, 1)
    
    		appendToResults := func(value reflect.Value) {
    			if _, isZero := rel.Field.ValueOf(ctx, value); !isZero {
    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)
  3. tests/transaction_test.go

    		}
    	})
    }
    
    func TestCancelTransaction(t *testing.T) {
    	ctx := context.Background()
    	ctx, cancelFunc := context.WithCancel(ctx)
    	cancelFunc()
    
    	user := *GetUser("cancel_transaction", Config{})
    	DB.Create(&user)
    
    	err := DB.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
    		var result User
    		tx.First(&result, user.ID)
    		return nil
    	})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  4. tests/tracer_test.go

    }
    
    func (S Tracer) Error(ctx context.Context, s string, i ...interface{}) {
    	S.Logger.Error(ctx, s, i...)
    }
    
    func (S Tracer) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
    	S.Logger.Trace(ctx, begin, fc, err)
    	S.Test(ctx, begin, fc, err)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 18 09:28:06 GMT 2022
    - 830 bytes
    - Viewed (0)
  5. tests/scanner_valuer_test.go

    }
    
    type NullString struct {
    	sql.NullString
    }
    
    type Point struct {
    	X, Y int
    }
    
    func (point Point) GormDataType() string {
    	return "geo"
    }
    
    func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr {
    	return clause.Expr{
    		SQL:  "ST_PointFromText(?)",
    		Vars: []interface{}{fmt.Sprintf("POINT(%d %d)", point.X, point.Y)},
    	}
    }
    
    func TestGORMValuer(t *testing.T) {
    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)
  6. interfaces.go

    }
    
    type ParamsFilter interface {
    	ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{})
    }
    
    // ConnPool db conns pool interface
    type ConnPool interface {
    	PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
    	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
    	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. tests/serializer_test.go

    	switch value := dbValue.(type) {
    	case []byte:
    		err = field.Set(ctx, dst, bytes.TrimPrefix(value, c.prefix))
    	case string:
    		err = field.Set(ctx, dst, strings.TrimPrefix(value, string(c.prefix)))
    	default:
    		err = fmt.Errorf("unsupported data %#v", dbValue)
    	}
    	return err
    }
    
    func (c *CustomSerializer) Value(ctx context.Context, field *schema.Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  8. migrator/migrator.go

    	gorm.Dialector
    }
    
    type printSQLLogger struct {
    	logger.Interface
    }
    
    func (l *printSQLLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
    	sql, _ := fc()
    	fmt.Println(sql + ";")
    	l.Interface.Trace(ctx, begin, fc, err)
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. schema/field.go

    			case int8:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case int16:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case int32:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case uint:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case uint8:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case uint16:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  10. tests/preload_test.go

    					{Name: "Jinzhu Tool 2"},
    				},
    			},
    		},
    	}
    
    	DB.Create(&users)
    
    	query := make([]string, 0)
    	sess := DB.Session(&gorm.Session{Logger: Tracer{
    		Logger: DB.Config.Logger,
    		Test: func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
    			sql, _ := fc()
    			query = append(query, sql)
    		},
    	}})
    
    	var result []User
    	err := sess.
    		Joins("Manager").
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
Back to top