Created
May 13, 2021 13:10
-
-
Save Solution/da8d1a28d92ca3cc794139a256eb5709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
// always use new session | |
qo := NewQueryObject(database.Session(&gorm.Session{NewDB: true})). | |
FilterByUsername("myUsername"). | |
FilterByActive() | |
// and now retrieve the model | |
var user model.User | |
qo.GetQuery().First(&user) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment