Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 71 for pool (0.14 sec)

  1. schema/pool.go

    package schema
    
    import (
    	"reflect"
    	"sync"
    )
    
    // sync pools
    var (
    	normalPool      sync.Map
    	poolInitializer = func(reflectType reflect.Type) FieldNewValuePool {
    		v, _ := normalPool.LoadOrStore(reflectType, &sync.Pool{
    			New: func() interface{} {
    				return reflect.New(reflectType).Interface()
    			},
    		})
    		return v.(FieldNewValuePool)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 11 13:37:44 GMT 2022
    - 345 bytes
    - Viewed (0)
  2. schema/interfaces.go

    	Build() (sql string, vars []interface{})
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    	GormDataType() string
    }
    
    // FieldNewValuePool field new scan value pool
    type FieldNewValuePool interface {
    	Get() interface{}
    	Put(interface{})
    }
    
    // CreateClausesInterface create clauses interface
    type CreateClausesInterface interface {
    	CreateClauses(*Field) []clause.Interface
    }
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  3. interfaces.go

    type Plugin interface {
    	Name() string
    	Initialize(*DB) error
    }
    
    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)
    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)
  4. finisher_api.go

    	}
    	Scan(rows, tx, ScanInitialized)
    	return tx.Error
    }
    
    // Connection uses a db connection to execute an arbitrary number of commands in fc. When finished, the connection is
    // returned to the connection pool.
    func (db *DB) Connection(fc func(tx *DB) error) (err error) {
    	if db.Error != nil {
    		return db.Error
    	}
    
    	tx := db.getInstance()
    	sqlDB, err := tx.DB()
    	if err != nil {
    		return
    	}
    
    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)
  5. migrator/index.go

    }
    
    // PrimaryKey returns the index is primary key or not.
    func (idx Index) PrimaryKey() (isPrimaryKey bool, ok bool) {
    	return idx.PrimaryKeyValue.Bool, idx.PrimaryKeyValue.Valid
    }
    
    // Unique returns whether the index is unique or not.
    func (idx Index) Unique() (unique bool, ok bool) {
    	return idx.UniqueValue.Bool, idx.UniqueValue.Valid
    }
    
    // Option return the optional attribute of the index
    func (idx Index) Option() string {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 02:32:46 GMT 2023
    - 1023 bytes
    - Viewed (0)
  6. callbacks/associations.go

    		}
    	} else {
    		onConflict.DoNothing = true
    	}
    
    	return
    }
    
    func saveAssociations(db *gorm.DB, rel *schema.Relationship, rValues reflect.Value, selectColumns map[string]bool, restricted bool, defaultUpdatingColumns []string) error {
    	// stop save association loop
    	if checkAssociationsSaved(db, rValues) {
    		return nil
    	}
    
    	var (
    		selects, omits []string
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  7. clause/expression.go

    }
    
    // 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
    	)
    
    	for _, v := range []byte(expr.SQL) {
    		if v == '?' && len(expr.Vars) > idx {
    			if afterParenthesis || expr.WithoutParentheses {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  8. utils/utils.go

    		}
    	}
    
    	return ""
    }
    
    func IsValidDBNameChar(c rune) bool {
    	return !unicode.IsLetter(c) && !unicode.IsNumber(c) && c != '.' && c != '*' && c != '_' && c != '$' && c != '@'
    }
    
    // CheckTruth check string true or not
    func CheckTruth(vals ...string) bool {
    	for _, val := range vals {
    		if val != "" && !strings.EqualFold(val, "false") {
    			return true
    		}
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  9. migrator/migrator.go

    func (m Migrator) ReorderModels(values []interface{}, autoAdd bool) (results []interface{}) {
    	type Dependency struct {
    		*gorm.Statement
    		Depends []*schema.Schema
    	}
    
    	var (
    		modelNames, orderedModelNames []string
    		orderedModelNamesMap          = map[string]bool{}
    		parsedSchemas                 = map[*schema.Schema]bool{}
    		valuesMap                     = map[string]Dependency{}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  10. logger/sql.go

    	"strings"
    	"time"
    	"unicode"
    
    	"gorm.io/gorm/utils"
    )
    
    const (
    	tmFmtWithMS = "2006-01-02 15:04:05.999"
    	tmFmtZero   = "0000-00-00 00:00:00"
    	nullStr     = "NULL"
    )
    
    func isPrintable(s string) bool {
    	for _, r := range s {
    		if !unicode.IsPrint(r) {
    			return false
    		}
    	}
    	return true
    }
    
    // A list of Go types that should be converted to SQL primitives
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
Back to top