Skip to content

Using Unscoped() for a specific preload/join #7659

@ZakkProjects

Description

@ZakkProjects

Your Question

Since issue #6058 there is a possibility to use Unscoped() for childs inside Preload()/Join() with syntax similar to: db.Model(&User{}).Unscoped().InnerJoins("Courses", db.Where("X = ?, y)).Find(&ref)

But is it possible to use Unscoped() only for specific preload and joins (possibly with cascading behavior for preloads) ?

db.Model(&User{}).InnerJoins("Courses", db.Unscoped().Where("x = ?", y)).Find(&ref)

The document you expected this should be explained

None

Expected answer

Is it already possible (and how), bug or should i change it to feature request.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions