Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 70 for tool (0.17 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)
    	}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 11 13:37:44 UTC 2022
    - 345 bytes
    - Viewed (0)
  2. gorm.go

    type Session struct {
    	DryRun                   bool
    	PrepareStmt              bool
    	NewDB                    bool
    	Initialized              bool
    	SkipHooks                bool
    	SkipDefaultTransaction   bool
    	DisableNestedTransaction bool
    	AllowGlobalUpdate        bool
    	FullSaveAssociations     bool
    	QueryFields              bool
    	Context                  context.Context
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Aug 20 11:46:56 UTC 2023
    - 11.6K bytes
    - Viewed (0)
  3. migrator.go

    	ColumnType() (columnType string, ok bool) // varchar(64)
    	PrimaryKey() (isPrimaryKey bool, ok bool)
    	AutoIncrement() (isAutoIncrement bool, ok bool)
    	Length() (length int64, ok bool)
    	DecimalSize() (precision int64, scale int64, ok bool)
    	Nullable() (nullable bool, ok bool)
    	Unique() (unique bool, ok bool)
    	ScanType() reflect.Type
    	Comment() (value string, ok bool)
    	DefaultValue() (value string, ok bool)
    }
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  4. callbacks/callbacks.go

    	deleteClauses = []string{"DELETE", "FROM", "WHERE"}
    )
    
    type Config struct {
    	LastInsertIDReversed bool
    	CreateClauses        []string
    	QueryClauses         []string
    	UpdateClauses        []string
    	DeleteClauses        []string
    }
    
    func RegisterDefaultCallbacks(db *gorm.DB, config *Config) {
    	enableTransaction := func(db *gorm.DB) bool {
    		return !db.SkipDefaultTransaction
    	}
    
    	if len(config.CreateClauses) == 0 {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Oct 27 23:56:55 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  5. tests/error_translator_test.go

    		Name string `gorm:"unique"`
    	}
    
    	db, err := OpenTestConnection(&gorm.Config{TranslateError: true})
    	if err != nil {
    		t.Fatalf("failed to connect database, got error %v", err)
    	}
    
    	dialectors := map[string]bool{"sqlite": true, "postgres": true, "mysql": true, "sqlserver": true}
    	if supported, found := dialectors[db.Dialector.Name()]; !(found && supported) {
    		return
    	}
    
    	DB.Migrator().DropTable(&City{})
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jul 12 13:21:22 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  6. callbacks/delete.go

    	"gorm.io/gorm/utils"
    )
    
    func BeforeDelete(db *gorm.DB) {
    	if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && db.Statement.Schema.BeforeDelete {
    		callMethod(db, func(value interface{}, tx *gorm.DB) bool {
    			if i, ok := value.(BeforeDeleteInterface); ok {
    				db.AddError(i.BeforeDelete(tx))
    				return true
    			}
    
    			return false
    		})
    	}
    }
    
    func DeleteBeforeAssociations(db *gorm.DB) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Feb 25 02:48:23 UTC 2022
    - 5.6K bytes
    - Viewed (0)
  7. callbacks/query.go

    				}
    			}
    
    			specifiedRelationsName := make(map[string]interface{})
    			for _, join := range db.Statement.Joins {
    				if db.Statement.Schema != nil {
    					var isRelations bool // is relations or raw sql
    					var relations []*schema.Relationship
    					relation, ok := db.Statement.Schema.Relationships.Relations[join.Name]
    					if ok {
    						isRelations = true
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:51:44 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  8. tests/preload_test.go

    			Manager: &User{
    				Name: "Alexis Manager",
    				Tools: []Tools{
    					{Name: "Alexis Tool 1"},
    					{Name: "Alexis Tool 2"},
    				},
    			},
    		},
    		{
    			Name: "TestMergeNestedPreloadWithNestedJoin-2",
    			Manager: &User{
    				Name: "Jinzhu Manager",
    				Tools: []Tools{
    					{Name: "Jinzhu Tool 1"},
    					{Name: "Jinzhu Tool 2"},
    				},
    			},
    		},
    	}
    
    	DB.Create(&users)
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  9. 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
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Jan 12 08:42:21 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  10. schema/relationship.go

    type Polymorphic struct {
    	PolymorphicID   *Field
    	PolymorphicType *Field
    	Value           string
    }
    
    type Reference struct {
    	PrimaryKey    *Field
    	PrimaryValue  string
    	ForeignKey    *Field
    	OwnPrimaryKey bool
    }
    
    func (schema *Schema) parseRelation(field *Field) *Relationship {
    	var (
    		err        error
    		fieldValue = reflect.New(field.IndirectFieldType).Interface()
    		relation   = &Relationship{
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
Back to top