Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 87 for interfaces (0.26 sec)

  1. 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 21 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  2. callbacks/interfaces.go

    package callbacks
    
    import "gorm.io/gorm"
    
    type BeforeCreateInterface interface {
    	BeforeCreate(*gorm.DB) error
    }
    
    type AfterCreateInterface interface {
    	AfterCreate(*gorm.DB) error
    }
    
    type BeforeUpdateInterface interface {
    	BeforeUpdate(*gorm.DB) error
    }
    
    type AfterUpdateInterface interface {
    	AfterUpdate(*gorm.DB) error
    }
    
    type BeforeSaveInterface interface {
    	BeforeSave(*gorm.DB) error
    }
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Aug 27 07:03:57 GMT 2020
    - 667 bytes
    - Viewed (0)
  3. schema/interfaces.go

    type CreateClausesInterface interface {
    	CreateClauses(*Field) []clause.Interface
    }
    
    // QueryClausesInterface query clauses interface
    type QueryClausesInterface interface {
    	QueryClauses(*Field) []clause.Interface
    }
    
    // UpdateClausesInterface update clauses interface
    type UpdateClausesInterface interface {
    	UpdateClauses(*Field) []clause.Interface
    }
    
    // DeleteClausesInterface delete clauses interface
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  4. clause/where_test.go

    			[]interface{}{"1", 100},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    				Exprs: []clause.Expression{clause.Not(clause.Expr{SQL: "`score` <= ?", Vars: []interface{}{100}},
    					clause.Expr{SQL: "`age` <= ?", Vars: []interface{}{60}})},
    			}},
    			"SELECT * FROM `users` WHERE NOT (`score` <= ? AND `age` <= ?)",
    			[]interface{}{100, 60},
    		},
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 05 02:23:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  5. schema/utils.go

    	var (
    		results       = [][]interface{}{}
    		dataResults   = map[string][]reflect.Value{}
    		loaded        = map[interface{}]bool{}
    		notZero, zero bool
    	)
    
    	if reflectValue.Kind() == reflect.Ptr ||
    		reflectValue.Kind() == reflect.Interface {
    		reflectValue = reflectValue.Elem()
    	}
    
    	switch reflectValue.Kind() {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  6. clause/group_by_test.go

    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.GroupBy{
    				Columns: []clause.Column{{Name: "role"}},
    				Having:  []clause.Expression{clause.Eq{"role", "admin"}},
    			}},
    			"SELECT * FROM `users` GROUP BY `role` HAVING `role` = ?",
    			[]interface{}{"admin"},
    		},
    		{
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  7. tests/scanner_valuer_test.go

    	}
    
    	if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) {
    		t.Errorf("generated vars is not equal, got %v", stmt.Vars)
    	}
    
    	stmt = dryRunDB.Model(UserWithPoint{}).Create(map[string]interface{}{
    		"Name":  "jinzhu",
    		"Point": clause.Expr{SQL: "ST_PointFromText(?)", Vars: []interface{}{"POINT(100 100)"}},
    	}).Statement
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  8. callbacks/callmethod.go

    package callbacks
    
    import (
    	"reflect"
    
    	"gorm.io/gorm"
    )
    
    func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) {
    	tx := db.Session(&gorm.Session{NewDB: true})
    	if called := fc(db.Statement.ReflectValue.Interface(), tx); !called {
    		switch db.Statement.ReflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			db.Statement.CurDestIndex = 0
    			for i := 0; i < db.Statement.ReflectValue.Len(); i++ {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 846 bytes
    - Viewed (0)
  9. clause/from_test.go

    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestFrom(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}},
    			"SELECT * FROM `users`", nil,
    		},
    		{
    			[]clause.Interface{
    				clause.Select{}, clause.From{
    					Tables: []clause.Table{{Name: "users"}},
    					Joins: []clause.Join{
    						{
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  10. prepare_stmt.go

    	if tx, ok := connPool.(Tx); ok {
    		return &PreparedStmtTX{PreparedStmtDB: db, Tx: tx}, nil
    	}
    	return nil, ErrInvalidTransaction
    }
    
    func (db *PreparedStmtDB) ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) {
    	stmt, err := db.prepare(ctx, db.ConnPool, false, query)
    	if err == nil {
    		result, err = stmt.ExecContext(ctx, args...)
    		if errors.Is(err, driver.ErrBadConn) {
    			db.Mux.Lock()
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
Back to top