Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for ctime (0.14 sec)

  1. utils/tests/utils.go

    		isEqual := func() {
    			if curTime, ok := got.(time.Time); ok {
    				format := "2006-01-02T15:04:05Z07:00"
    
    				if curTime.Round(time.Second).UTC().Format(format) != expect.(time.Time).Round(time.Second).UTC().Format(format) && curTime.Truncate(time.Second).UTC().Format(format) != expect.(time.Time).Truncate(time.Second).UTC().Format(format) {
    					t.Errorf("%v: expect: %v, got %v after time round", utils.FileWithLineNum(), expect.(time.Time), curTime)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. logger/logger.go

    type traceRecorder struct {
    	Interface
    	BeginAt      time.Time
    	SQL          string
    	RowsAffected int64
    	Err          error
    }
    
    // New trace recorder
    func (l *traceRecorder) New() *traceRecorder {
    	return &traceRecorder{Interface: l.Interface, BeginAt: time.Now()}
    }
    
    // Trace implement logger interface
    func (l *traceRecorder) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:19:41 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  3. model.go

    package gorm
    
    import "time"
    
    // Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt
    // It may be embedded into your model or you may build your own model without it
    //
    //	type User struct {
    //	  gorm.Model
    //	}
    type Model struct {
    	ID        uint `gorm:"primarykey"`
    	CreatedAt time.Time
    	UpdatedAt time.Time
    	DeletedAt DeletedAt `gorm:"index"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:06:43 GMT 2023
    - 396 bytes
    - Viewed (0)
  4. tests/customize_field_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestCustomizeColumn(t *testing.T) {
    	type CustomizeColumn struct {
    		ID   int64      `gorm:"column:mapped_id; primary_key:yes"`
    		Name string     `gorm:"column:mapped_name"`
    		Date *time.Time `gorm:"column:mapped_time"`
    	}
    
    	DB.Migrator().DropTable(&CustomizeColumn{})
    	DB.AutoMigrate(&CustomizeColumn{})
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Sep 11 09:33:31 GMT 2020
    - 6.9K bytes
    - Viewed (0)
  5. tests/migrate_test.go

    		Name     string
    		Salary   float64
    		Birthday time.Time `gorm:"precision:4"`
    	}
    
    	DB.Migrator().DropTable(&UserMigrateColumn{})
    
    	DB.AutoMigrate(&UserMigrateColumn{})
    
    	type UserMigrateColumn2 struct {
    		ID                  uint
    		Name                string    `gorm:"size:128"`
    		Salary              float64   `gorm:"precision:2"`
    		Birthday            time.Time `gorm:"precision:2"`
    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)
  6. callbacks/create.go

    	default:
    		var (
    			selectColumns, restricted = stmt.SelectAndOmitColumns(true, false)
    			_, updateTrackTime        = stmt.Get("gorm:update_track_time")
    			isZero                    bool
    		)
    		stmt.Settings.Delete("gorm:update_track_time")
    
    		values = clause.Values{Columns: make([]clause.Column, 0, len(stmt.Schema.DBNames))}
    
    		for _, db := range stmt.Schema.DBNames {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  7. finisher_api.go

    	case reflect.Slice, reflect.Array:
    		if _, ok := tx.Statement.Clauses["ON CONFLICT"]; !ok {
    			tx = tx.Clauses(clause.OnConflict{UpdateAll: true})
    		}
    		tx = tx.callbacks.Create().Execute(tx.Set("gorm:update_track_time", true))
    	case reflect.Struct:
    		if err := tx.Statement.Parse(value); err == nil && tx.Statement.Schema != nil {
    			for _, pf := range tx.Statement.Schema.PrimaryFields {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  8. schema/field_test.go

    		{Name: "TIME", DBName: "ftime", BindNames: []string{"TIME"}, DataType: schema.Time, Creatable: true, Updatable: true, Readable: true, Tag: `gorm:"column:ftime"`},
    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)
  9. schema/field.go

    		switch fieldValue.Elem().Interface().(type) {
    		case time.Time:
    			field.Set = func(ctx context.Context, value reflect.Value, v interface{}) error {
    				switch data := v.(type) {
    				case **time.Time:
    					if data != nil && *data != nil {
    						field.Set(ctx, value, *data)
    					}
    				case time.Time:
    					field.ReflectValueOf(ctx, value).Set(reflect.ValueOf(v))
    				case *time.Time:
    					if data != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  10. tests/non_std_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    )
    
    type Animal struct {
    	Counter    uint64 `gorm:"primary_key:yes"`
    	Name       string `gorm:"DEFAULT:'galeone'"`
    	From       string // test reserved sql keyword as field name
    	Age        *time.Time
    	unexported string // unexported value
    	CreatedAt  time.Time
    	UpdatedAt  time.Time
    }
    
    func TestNonStdPrimaryKeyAndDefaultValues(t *testing.T) {
    	DB.Migrator().DropTable(&Animal{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top