Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for Timestamp (0.2 sec)

  1. tests/postgres_test.go

    		t.Skip()
    	}
    
    	type Yasuo struct {
    		ID        string `gorm:"default:gen_random_uuid()"`
    		Name      string
    		CreatedAt time.Time `gorm:"type:TIMESTAMP WITHOUT TIME ZONE"`
    		UpdatedAt time.Time `gorm:"type:TIMESTAMP WITHOUT TIME ZONE;default:current_timestamp"`
    	}
    
    	if err := DB.Exec("CREATE EXTENSION IF NOT EXISTS pgcrypto;").Error; err != nil {
    		t.Errorf("Failed to create extension pgcrypto, got error %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  2. chainable_api.go

    	tx.Statement.assigns = attrs
    	return
    }
    
    // Unscoped disables the global scope of soft deletion in a query.
    // By default, GORM uses soft deletion, marking records as "deleted"
    // by setting a timestamp on a specific field (e.g., `deleted_at`).
    // Unscoped allows queries to include records marked as deleted,
    // overriding the soft deletion behavior.
    // Example:
    //    var users []User
    //    db.Unscoped().Find(&users)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. tests/migrate_test.go

    	if DB.Dialector.Name() != "mysql" {
    		return
    	}
    	type CurrentTimestampTest struct {
    		ID     string     `gorm:"primary_key"`
    		TimeAt *time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP;unique"`
    	}
    	var err error
    	err = DB.Migrator().DropTable(&CurrentTimestampTest{})
    	if err != nil {
    		t.Errorf("DropTable err:%v", err)
    	}
    	err = DB.AutoMigrate(&CurrentTimestampTest{})
    	if err != nil {
    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)
  4. gorm.go

    	NamingStrategy schema.Namer
    	// FullSaveAssociations full save associations
    	FullSaveAssociations bool
    	// Logger
    	Logger logger.Interface
    	// NowFunc the function to be used when creating a new timestamp
    	NowFunc func() time.Time
    	// DryRun generate sql without execute
    	DryRun bool
    	// PrepareStmt executes the given query in cached statement
    	PrepareStmt bool
    	// DisableAutomaticPing
    	DisableAutomaticPing bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
Back to top