173 lines
4.5 KiB
Go
173 lines
4.5 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package db
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type AuthType string
|
|
|
|
const (
|
|
AuthTypeDiscord AuthType = "discord"
|
|
AuthTypeGoogle AuthType = "google"
|
|
AuthTypePassword AuthType = "password"
|
|
)
|
|
|
|
func (e *AuthType) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AuthType(s)
|
|
case string:
|
|
*e = AuthType(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AuthType: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAuthType struct {
|
|
AuthType AuthType `json:"auth_type"`
|
|
Valid bool `json:"valid"` // Valid is true if AuthType is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAuthType) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AuthType, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AuthType.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAuthType) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AuthType), nil
|
|
}
|
|
|
|
type EntrantType string
|
|
|
|
const (
|
|
EntrantTypeSingle EntrantType = "single"
|
|
EntrantTypeTeam EntrantType = "team"
|
|
)
|
|
|
|
func (e *EntrantType) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = EntrantType(s)
|
|
case string:
|
|
*e = EntrantType(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for EntrantType: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullEntrantType struct {
|
|
EntrantType EntrantType `json:"entrant_type"`
|
|
Valid bool `json:"valid"` // Valid is true if EntrantType is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullEntrantType) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.EntrantType, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.EntrantType.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullEntrantType) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.EntrantType), nil
|
|
}
|
|
|
|
type AuthMethod struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
UserID pgtype.UUID `json:"user_id"`
|
|
Type AuthType `json:"type"`
|
|
Value string `json:"value"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Bracket struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
EventID pgtype.UUID `json:"event_id"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type BracketEntrant struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
SeedOrder int32 `json:"seed_order"`
|
|
EntrantID pgtype.UUID `json:"entrant_id"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Entrant struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
EventID pgtype.UUID `json:"event_id"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Event struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Match struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Player1 pgtype.UUID `json:"player1"`
|
|
Player2 pgtype.UUID `json:"player2"`
|
|
Player1From pgtype.UUID `json:"player1_from"`
|
|
Player2From pgtype.UUID `json:"player2_from"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Team struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type TeamEntrant struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
TeamID pgtype.UUID `json:"team_id"`
|
|
EntrantID pgtype.UUID `json:"entrant_id"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type User struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
Bio string `json:"bio"`
|
|
ProfilePhoto pgtype.Text `json:"profile_photo"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|