- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 116 for Unscoped (0.28 sec)
-
tests/helper_test.go
} func isMysql() bool { return os.Getenv("GORM_DIALECT") == "mysql" } func isSqlite() bool { return os.Getenv("GORM_DIALECT") == "sqlite" } func db(unscoped bool) *gorm.DB { if unscoped { return DB.Unscoped() } else { return DB }
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 8K bytes - Viewed (0) -
tests/soft_delete_test.go
t.Errorf("Age soft deleted record, expects: %v, got: %v", 0, age) } if err := DB.Unscoped().First(&User{}, "name = ?", user.Name).Error; err != nil { t.Errorf("Should find soft deleted record with Unscoped, but got err %s", err) } count = 0 if DB.Unscoped().Model(&User{}).Where("name = ?", user.Name).Count(&count).Error != nil || count != 1 {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Wed Feb 01 06:40:55 GMT 2023 - 5.7K bytes - Viewed (0) -
maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
Java - Registered: Sun Apr 21 03:35:09 GMT 2024 - Last Modified: Tue Dec 05 08:11:33 GMT 2023 - 6.7K bytes - Viewed (0) -
soft_delete.go
} func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause) { } func (sd SoftDeleteQueryClause) ModifyStatement(stmt *Statement) { if _, ok := stmt.Clauses["soft_delete_enabled"]; !ok && !stmt.Statement.Unscoped { if c, ok := stmt.Clauses["WHERE"]; ok { if where, ok := c.Expression.(clause.Where); ok && len(where.Exprs) >= 1 { for _, expr := range where.Exprs {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Wed Feb 01 06:40:55 GMT 2023 - 4.5K bytes - Viewed (0) -
tests/joins_table_test.go
t.Fatalf("Should found soft deleted addresses with unscoped") } DB.Model(&person).Association("Addresses").Clear() if DB.Model(&person).Association("Addresses").Count() != 0 { t.Fatalf("Should deleted all addresses") } if DB.Unscoped().Model(&person).Association("Addresses").Count() != 2 { t.Fatalf("Should found soft deleted addresses with unscoped") } DB.Unscoped().Model(&person).Association("Addresses").Clear()
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Thu Sep 10 13:46:18 GMT 2020 - 3.5K bytes - Viewed (0) -
tests/delete_test.go
if err := DB.Table("deleted_users").Unscoped().First(&result3, user.ID).Error; err != nil { t.Fatalf("failed to find record, got error %v", err) } if err := DB.Table("deleted_users").Unscoped().Delete(&result).Error; err != nil { t.Errorf("failed to delete user with unscoped, got error %v", err) } var result4 UserWithDelete
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Tue Oct 10 07:03:34 GMT 2023 - 9.4K bytes - Viewed (0) -
chainable_api.go
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 Apr 21 09:35:09 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
tests/sql_builder_test.go
t.Fatalf("invalid sql generated, got %v", sql) } sql = dryRunDB.Where("a = ? or b = ?", "a", "b").Unscoped().Find(&User{}).Statement.SQL.String() if !regexp.MustCompile(`WHERE a = .+ or b = .+$`).MatchString(sql) { t.Fatalf("invalid sql generated, got %v", sql) } sql = dryRunDB.Or("a = ? or b = ?", "a", "b").Unscoped().Find(&User{}).Statement.SQL.String() if !regexp.MustCompile(`WHERE a = .+ or b = .+$`).MatchString(sql) {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 16.7K bytes - Viewed (0) -
maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java
Java - Registered: Sun Apr 21 03:35:09 GMT 2024 - Last Modified: Mon Dec 26 15:12:32 GMT 2022 - 5.2K bytes - Viewed (0) -
callbacks/delete.go
modelValue := reflect.New(rel.FieldSchema.ModelType).Interface() tx := db.Session(&gorm.Session{NewDB: true}).Model(modelValue) withoutConditions := false if db.Statement.Unscoped { tx = tx.Unscoped() } if len(db.Statement.Selects) > 0 { selects := make([]string, 0, len(db.Statement.Selects)) for _, s := range db.Statement.Selects { if s == clause.Associations {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Fri Feb 25 02:48:23 GMT 2022 - 5.6K bytes - Viewed (0)