Created
August 20, 2023 11:54
-
-
Save masahiko-nitanda/92fa827506b15add82347938a5979e9e to your computer and use it in GitHub Desktop.
This Gist is a Go code snippet using GORM to query the "users" table for the first user with the name "Alice". The code uses the Table method to specify the table and performs a search based on the name field.
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
db.Table("users").Where("name = ?", "Alice").First(&user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment