Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 142 for func (0.29 sec)

  1. clause/expression.go

    			builder.AddVar(builder, neq.Value)
    		}
    	}
    }
    
    func (neq Neq) NegationBuild(builder Builder) {
    	Eq(neq).Build(builder)
    }
    
    // Gt greater than for where
    type Gt Eq
    
    func (gt Gt) Build(builder Builder) {
    	builder.WriteQuoted(gt.Column)
    	builder.WriteString(" > ")
    	builder.AddVar(builder, gt.Value)
    }
    
    func (gt Gt) NegationBuild(builder Builder) {
    	Lte(gt).Build(builder)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  2. tests/tracer_test.go

    )
    
    type Tracer struct {
    	Logger logger.Interface
    	Test   func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)
    }
    
    func (S Tracer) LogMode(level logger.LogLevel) logger.Interface {
    	return S.Logger.LogMode(level)
    }
    
    func (S Tracer) Info(ctx context.Context, s string, i ...interface{}) {
    	S.Logger.Info(ctx, s, i...)
    }
    
    func (S Tracer) Warn(ctx context.Context, s string, i ...interface{}) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 18 09:28:06 GMT 2022
    - 830 bytes
    - Viewed (0)
  3. utils/utils.go

    	"fmt"
    	"path/filepath"
    	"reflect"
    	"runtime"
    	"strconv"
    	"strings"
    	"unicode"
    )
    
    var gormSourceDir string
    
    func init() {
    	_, file, _, _ := runtime.Caller(0)
    	// compatible solution to get gorm source directory with various operating systems
    	gormSourceDir = sourceDir(file)
    }
    
    func sourceDir(file string) string {
    	dir := filepath.Dir(file)
    	dir = filepath.Dir(dir)
    
    	s := filepath.Dir(dir)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. schema/naming.go

    // RelationshipFKName generate fk name for relation
    func (ns NamingStrategy) RelationshipFKName(rel Relationship) string {
    	return ns.formatName("fk", rel.Schema.Table, ns.toDBName(rel.Name))
    }
    
    // CheckerName generate checker name
    func (ns NamingStrategy) CheckerName(table, column string) string {
    	return ns.formatName("chk", table, column)
    }
    
    // IndexName generate index name
    func (ns NamingStrategy) IndexName(table, column string) string {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  5. migrator/index.go

    }
    
    // Table return the table name of the index.
    func (idx Index) Table() string {
    	return idx.TableName
    }
    
    // Name return the name of the index.
    func (idx Index) Name() string {
    	return idx.NameValue
    }
    
    // Columns return the columns of the index
    func (idx Index) Columns() []string {
    	return idx.ColumnList
    }
    
    // PrimaryKey returns the index is primary key or not.
    func (idx Index) PrimaryKey() (isPrimaryKey bool, ok bool) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 02:32:46 GMT 2023
    - 1023 bytes
    - Viewed (0)
  6. tests/hooks_test.go

    	return
    }
    
    func (s *Product) BeforeSave(tx *gorm.DB) (err error) {
    	if s.Code == "dont_save" {
    		err = errors.New("can't save")
    	}
    	s.BeforeSaveCallTimes = s.BeforeSaveCallTimes + 1
    	return
    }
    
    func (s *Product) AfterFind(tx *gorm.DB) (err error) {
    	s.AfterFindCallTimes = s.AfterFindCallTimes + 1
    	return
    }
    
    func (s *Product) AfterCreate(tx *gorm.DB) (err error) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  7. clause/set.go

    package clause
    
    import "sort"
    
    type Set []Assignment
    
    type Assignment struct {
    	Column Column
    	Value  interface{}
    }
    
    func (set Set) Name() string {
    	return "SET"
    }
    
    func (set Set) Build(builder Builder) {
    	if len(set) > 0 {
    		for idx, assignment := range set {
    			if idx > 0 {
    				builder.WriteByte(',')
    			}
    			builder.WriteQuoted(assignment.Column)
    			builder.WriteByte('=')
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Nov 29 03:02:44 GMT 2021
    - 1.4K bytes
    - Viewed (0)
  8. schema/schema_helper_test.go

    				}
    			}
    
    			if !found {
    				t.Errorf("schema %v failed to found primary key: %v", s, field)
    			}
    		}
    	})
    }
    
    func checkSchemaField(t *testing.T, s *schema.Schema, f *schema.Field, fc func(*schema.Field)) {
    	t.Run("CheckField/"+f.Name, func(t *testing.T) {
    		if fc != nil {
    			fc(f)
    		}
    
    		if f.TagSettings == nil {
    			if f.Tag != "" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  9. callbacks/associations.go

    package callbacks
    
    import (
    	"reflect"
    	"strings"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    func SaveBeforeAssociations(create bool) func(db *gorm.DB) {
    	return func(db *gorm.DB) {
    		if db.Error == nil && db.Statement.Schema != nil {
    			selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create)
    
    			// Save Belongs To associations
    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)
  10. logger/sql.go

    func ExplainSQL(sql string, numericPlaceholder *regexp.Regexp, escaper string, avars ...interface{}) string {
    	var (
    		convertParams func(interface{}, int)
    		vars          = make([]string, len(avars))
    	)
    
    	convertParams = func(v interface{}, idx int) {
    		switch v := v.(type) {
    		case bool:
    			vars[idx] = strconv.FormatBool(v)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
Back to top