Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for context_b (0.14 sec)

  1. schema/serializer.go

    	Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error)
    }
    
    // JSONSerializer json serializer
    type JSONSerializer struct{}
    
    // Scan implements serializer interface
    func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) {
    	fieldValue := reflect.New(field.FieldType)
    
    	if dbValue != nil {
    		var bytes []byte
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  2. tests/connpool_test.go

    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.ExecContext(ctx, query, args...)
    }
    
    func (c *wrapperTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.QueryContext(ctx, query, args...)
    }
    
    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. callbacks.go

    		}
    	}
    
    	for _, f := range p.fns {
    		f(db)
    	}
    
    	if stmt.SQL.Len() > 0 {
    		db.Logger.Trace(stmt.Context, curTime, func() (string, int64) {
    			sql, vars := stmt.SQL.String(), stmt.Vars
    			if filter, ok := db.Logger.(ParamsFilter); ok {
    				sql, vars = filter.ParamsFilter(stmt.Context, stmt.SQL.String(), stmt.Vars...)
    			}
    			return db.Dialector.Explain(sql, vars...), db.RowsAffected
    		}, db.Error)
    	}
    
    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)
  4. tests/prepared_stmt_test.go

    import (
    	"context"
    	"errors"
    	"sync"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestPreparedStmt(t *testing.T) {
    	tx := DB.Session(&gorm.Session{PrepareStmt: true})
    
    	if _, ok := tx.ConnPool.(*gorm.PreparedStmtDB); !ok {
    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  5. scan.go

    	for idx, field := range fields {
    		if field == nil {
    			continue
    		}
    
    		if len(joinFields) == 0 || len(joinFields[idx]) == 0 {
    			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
    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. tests/tracer_test.go

    }
    
    func (S Tracer) Warn(ctx context.Context, s string, i ...interface{}) {
    	S.Logger.Warn(ctx, s, i...)
    }
    
    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 May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 18 09:28:06 GMT 2022
    - 830 bytes
    - Viewed (0)
  7. callbacks/associations.go

    							fv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, obj)
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, joinValue, fv))
    						} else if ref.PrimaryValue != "" {
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, joinValue, ref.PrimaryValue))
    						} else {
    							fv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, elem)
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, joinValue, fv))
    						}
    					}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  8. soft_delete.go

    		stmt.SetColumn(sd.Field.DBName, curTime, true)
    
    		if stmt.Schema != nil {
    			_, queryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
    			column, values := schema.ToQueryValues(stmt.Table, stmt.Schema.PrimaryFieldDBNames, queryValues)
    
    			if len(values) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  9. tests/scopes_test.go

    package tests_test
    
    import (
    	"context"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func NameIn1And2(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser1", "ScopeUser2"})
    }
    
    func NameIn2And3(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser2", "ScopeUser3"})
    }
    
    func NameIn(names []string) func(d *gorm.DB) *gorm.DB {
    	return func(d *gorm.DB) *gorm.DB {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  10. callbacks/query.go

    	"gorm.io/gorm/utils"
    )
    
    func Query(db *gorm.DB) {
    	if db.Error == nil {
    		BuildQuerySQL(db)
    
    		if !db.DryRun && db.Error == nil {
    			rows, err := db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
    			if err != nil {
    				db.AddError(err)
    				return
    			}
    			defer func() {
    				db.AddError(rows.Close())
    			}()
    			gorm.Scan(rows, db, 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)
Back to top