first commit
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.30.0
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
type QuestionType string
|
||||
|
||||
const (
|
||||
QuestionTypeShortText QuestionType = "short_text"
|
||||
QuestionTypeLongText QuestionType = "long_text"
|
||||
QuestionTypeMultipleChoice QuestionType = "multiple_choice"
|
||||
QuestionTypeCheckbox QuestionType = "checkbox"
|
||||
QuestionTypeDropdown QuestionType = "dropdown"
|
||||
QuestionTypeDate QuestionType = "date"
|
||||
QuestionTypeRating QuestionType = "rating"
|
||||
)
|
||||
|
||||
func (e *QuestionType) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = QuestionType(s)
|
||||
case string:
|
||||
*e = QuestionType(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for QuestionType: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullQuestionType struct {
|
||||
QuestionType QuestionType
|
||||
Valid bool // Valid is true if QuestionType is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullQuestionType) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.QuestionType, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.QuestionType.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullQuestionType) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.QuestionType), nil
|
||||
}
|
||||
|
||||
type Form struct {
|
||||
ID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
Title string
|
||||
Description pgtype.Text
|
||||
ResponseCount int32
|
||||
CreatedAt pgtype.Timestamptz
|
||||
UpdatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type Question struct {
|
||||
ID uuid.UUID
|
||||
FormID uuid.UUID
|
||||
Type QuestionType
|
||||
Title string
|
||||
Required bool
|
||||
Position int32
|
||||
}
|
||||
|
||||
type QuestionOption struct {
|
||||
ID int32
|
||||
FormID uuid.UUID
|
||||
QuestionID uuid.UUID
|
||||
Label string
|
||||
Position int32
|
||||
}
|
||||
|
||||
type RefreshToken struct {
|
||||
ID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
Token string
|
||||
ExpiresAt pgtype.Timestamptz
|
||||
CreatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID
|
||||
Email string
|
||||
PasswordHash string
|
||||
CreatedAt pgtype.Timestamptz
|
||||
UpdatedAt pgtype.Timestamptz
|
||||
}
|
||||
Reference in New Issue
Block a user