gopay/internal/database/account/insert.go
2024-06-06 19:17:16 +01:00

22 lines
375 B
Go

package account
import "github.com/rs/zerolog/log"
// Insert a model
func (a *Account) Insert(username, password string) error {
// Store model
model := &Model{
Username: username,
Password: password,
}
// Insert model
_, err := a.db.Insert(model)
if err != nil {
log.Err(err).Str("table", "account").Msg("Could not insert row")
return err
}
return nil
}