Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 26 for NOW (0.12 sec)

  1. logger/sql_test.go

    package logger_test
    
    import (
    	"database/sql/driver"
    	"encoding/json"
    	"fmt"
    	"regexp"
    	"strings"
    	"testing"
    
    	"github.com/jinzhu/now"
    	"gorm.io/gorm/logger"
    )
    
    type JSON json.RawMessage
    
    func (j JSON) Value() (driver.Value, error) {
    	if len(j) == 0 {
    		return nil, nil
    	}
    	return json.RawMessage(j).MarshalJSON()
    }
    
    type ExampleStruct struct {
    	Name string
    	Val  string
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  2. prepare_stmt.go

    	// suppose the maxopen is 1, g1 is creating record and g2 is querying record.
    	// 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1.
    	// 2. g2 select lock `conn.PrepareContext(ctx, query)`, now db.numOpen == db.maxOpen , wait for release.
    	// 3. g1 tx exec insert, wait for unlock `conn.PrepareContext(ctx, query)` to finish tx and release.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  3. tests/scanner_valuer_test.go

    		Age:      sql.NullInt64{Int64: 18, Valid: true},
    		Male:     sql.NullBool{Bool: true, Valid: true},
    		Height:   sql.NullFloat64{Float64: 1.8888, Valid: true},
    		Birthday: sql.NullTime{Time: time.Now(), Valid: true},
    		Allergen: NullString{sql.NullString{String: "Allergen", Valid: true}},
    		Password: EncryptedData("pass1"),
    		Bytes:    []byte("byte"),
    		Num:      18,
    		Strings:  StringsSlice{"a", "b", "c"},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    	"gorm.io/gorm/utils"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestMigrate(t *testing.T) {
    	allModels := []interface{}{&User{}, &Account{}, &Pet{}, &Company{}, &Toy{}, &Language{}, &Tools{}}
    	rand.Seed(time.Now().UnixNano())
    	rand.Shuffle(len(allModels), func(i, j int) { allModels[i], allModels[j] = allModels[j], allModels[i] })
    	DB.Migrator().DropTable("user_speaks", "user_friends", "ccc")
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  5. tests/helper_test.go

    	Toys      int
    	Company   bool
    	Manager   bool
    	Team      int
    	Languages int
    	Friends   int
    	NamedPet  bool
    	Tools     int
    }
    
    func GetUser(name string, config Config) *User {
    	var (
    		birthday = time.Now().Round(time.Second)
    		user     = User{
    			Name:     name,
    			Age:      18,
    			Birthday: &birthday,
    		}
    	)
    
    	if config.Account {
    		user.Account = Account{Number: name + "_account"}
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  6. tests/update_test.go

    	db := DB.Model(&user).UpdateColumns(User{Age: newAge})
    
    	if db.RowsAffected != 1 {
    		t.Errorf("Expected RowsAffected=1 but instead RowsAffected=%v", db.RowsAffected)
    	}
    
    	// Verify that Age now=`newAge`.
    	result := &User{}
    	result.ID = user.ID
    	DB.Preload("Account").First(result)
    
    	if result.Age != newAge {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  7. schema/field_test.go

    		user          = tests.User{
    			Model: gorm.Model{
    				ID:        10,
    				CreatedAt: time.Now(),
    				UpdatedAt: time.Now(),
    				DeletedAt: gorm.DeletedAt{Time: time.Now(), Valid: true},
    			},
    			Name:     "valuer_and_setter",
    			Age:      18,
    			Birthday: tests.Now(),
    			Active:   true,
    		}
    		reflectValue = reflect.ValueOf(&user)
    	)
    
    	// test valuer
    	values := map[string]interface{}{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  8. callbacks/update.go

    					if v, ok := selectColumns[field.DBName]; (ok && v) || !ok {
    						now := stmt.DB.NowFunc()
    						assignValue(field, now)
    
    						if field.AutoUpdateTime == schema.UnixNanosecond {
    							set = append(set, clause.Assignment{Column: clause.Column{Name: field.DBName}, Value: now.UnixNano()})
    						} else if field.AutoUpdateTime == schema.UnixMillisecond {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  9. README.md

    ## Contributors
    
    [Thank you](https://github.com/go-gorm/gorm/graphs/contributors) for contributing to the GORM framework!
    
    ## License
    
    © Jinzhu, 2013~time.Now
    
    Plain Text
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  10. utils/utils_test.go

    }
    
    func TestAssertEqual(t *testing.T) {
    	now := time.Now()
    	assertEqualTests := []struct {
    		name     string
    		src, dst interface{}
    		out      bool
    	}{
    		{"error equal", errors.New("1"), errors.New("1"), true},
    		{"error not equal", errors.New("1"), errors.New("2"), false},
    		{"driver.Valuer equal", ModifyAt{Time: now, Valid: true}, ModifyAt{Time: now, Valid: true}, true},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top