This commit is contained in:
2025-11-21 11:14:27 +03:00
parent 4fe13e55c6
commit bc1713cb71
5 changed files with 50 additions and 6 deletions

View File

@@ -1,6 +1,10 @@
package psql
import "github.com/shopspring/decimal"
import (
"kurumibot/database"
"github.com/shopspring/decimal"
)
type Group struct {
ID int
@@ -13,8 +17,8 @@ type Group struct {
MaxWaifus int
}
// func GetGroupById(id int) (*Group, error) {
// group := new(Group)
// // err := Database.Get(group, "select * from groups where id=$1;", id)
// return group, err
// }
func GetGroupById(id int) (*Group, error) {
group := new(Group)
tx := database.PostgresDatabase.First(group, "id = ?", id)
return group, tx.Error
}