- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 52 for Unscoped (0.1 sec)
-
callbacks/preload.go
} } else { tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks}) tx.Statement.ReflectValue = db.Statement.ReflectValue tx.Statement.Unscoped = db.Statement.Unscoped if err := preload(tx, rel, append(preloads[name], associationsConds...), preloadMap[name]); err != nil { return err } } } else {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:52:33 UTC 2024 - 11.6K bytes - Viewed (0) -
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 }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 8K bytes - Viewed (0) -
tests/preload_test.go
if len(user4.Pets) != 0 { t.Fatalf("User.Pet[0] was deleted and should not exist.") } var user5 User DB.Unscoped().Preload(clause.Associations+"."+clause.Associations).Find(&user5, "id = ?", user.ID) CheckUserUnscoped(t, user5, user) var user6 *User DB.Unscoped().Preload("Pets.Toy").Find(&user6, "id = ?", user.ID) CheckUserUnscoped(t, *user6, user) }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:00:47 UTC 2024 - 15.9K bytes - Viewed (0) -
impl/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java
} public <T> Provider<T> scope(final Key<T> key, Provider<T> unscoped) { Object qualifier = key.getAnnotation() instanceof Named n ? n.value() : key.getAnnotation(); org.apache.maven.di.Key<T> k = org.apache.maven.di.Key.ofType(key.getTypeLiteral().getType(), qualifier); return scope(k, unscoped::get)::get; }
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 3.3K 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)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 14.8K bytes - Viewed (0) -
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) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 16.7K bytes - Viewed (0) -
gorm.go
Clauses: map[string]clause.Clause{}, Vars: make([]interface{}, 0, 8), SkipHooks: db.Statement.SkipHooks, } if db.Config.PropagateUnscoped { tx.Statement.Unscoped = db.Statement.Unscoped } } else { // with clone statement tx.Statement = db.Statement.clone() tx.Statement.DB = tx } return tx } return db }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Oct 09 11:29:48 UTC 2024 - 12.1K bytes - Viewed (0) -
tests/associations_has_many_test.go
// test delete if err := tx.Model(&item).Association("Contents").Unscoped().Delete(&contents[0]); err != nil { t.Errorf("failed to delete Contents, got error: %v", err) } if count := tx.Model(&item).Association("Contents").Count(); count != 2 { t.Errorf("expected %d contents, got %d", 2, count) } // test clear if err := tx.Model(&item).Association("Contents").Unscoped().Clear(); err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 16K bytes - Viewed (0) -
statement.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 19.9K bytes - Viewed (0) -
association.go
} } else { association.Error = err } return association } func (association *Association) Unscoped() *Association { return &Association{ DB: association.DB, Relationship: association.Relationship, Error: association.Error, Unscope: true, } } func (association *Association) Find(out interface{}, conds ...interface{}) error { if association.Error == nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 21.5K bytes - Viewed (0)