refactor sqlite db to support sqlc

This commit is contained in:
2024-12-04 10:22:55 -06:00
parent 69ec9bd08c
commit bf58779227
12 changed files with 342 additions and 388 deletions

View File

@@ -1,6 +1,7 @@
package models
import (
"fmt"
"github.com/google/uuid"
"net/mail"
"strings"
@@ -99,10 +100,17 @@ func CustomerIdToString(customerId CustomerId) string {
type SessionId uuid.UUID
type UserId uuid.UUID
func UserIdFromString(userId string) UserId {
id, err := uuid.Parse(userId)
if err != nil {
fmt.Errorf("unable to parse user id %+v", err)
}
return UserId(id)
}
func (s *SessionId) String() string {
id := uuid.UUID(*s)
return id.String()
}
type UserEmail string