refact!: project structure
This commit is contained in:
parent
fd0ca4411b
commit
db53ae04e3
26 changed files with 971 additions and 6395 deletions
264
sql/models.go
Normal file
264
sql/models.go
Normal file
|
|
@ -0,0 +1,264 @@
|
|||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.30.0
|
||||
|
||||
package sqlc
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
type ReleaseSeasonT string
|
||||
|
||||
const (
|
||||
ReleaseSeasonTWinter ReleaseSeasonT = "winter"
|
||||
ReleaseSeasonTSpring ReleaseSeasonT = "spring"
|
||||
ReleaseSeasonTSummer ReleaseSeasonT = "summer"
|
||||
ReleaseSeasonTFall ReleaseSeasonT = "fall"
|
||||
)
|
||||
|
||||
func (e *ReleaseSeasonT) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = ReleaseSeasonT(s)
|
||||
case string:
|
||||
*e = ReleaseSeasonT(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for ReleaseSeasonT: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullReleaseSeasonT struct {
|
||||
ReleaseSeasonT ReleaseSeasonT `json:"release_season_t"`
|
||||
Valid bool `json:"valid"` // Valid is true if ReleaseSeasonT is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullReleaseSeasonT) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.ReleaseSeasonT, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.ReleaseSeasonT.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullReleaseSeasonT) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.ReleaseSeasonT), nil
|
||||
}
|
||||
|
||||
type StorageTypeT string
|
||||
|
||||
const (
|
||||
StorageTypeTLocal StorageTypeT = "local"
|
||||
StorageTypeTS3 StorageTypeT = "s3"
|
||||
)
|
||||
|
||||
func (e *StorageTypeT) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = StorageTypeT(s)
|
||||
case string:
|
||||
*e = StorageTypeT(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for StorageTypeT: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullStorageTypeT struct {
|
||||
StorageTypeT StorageTypeT `json:"storage_type_t"`
|
||||
Valid bool `json:"valid"` // Valid is true if StorageTypeT is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullStorageTypeT) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.StorageTypeT, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.StorageTypeT.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullStorageTypeT) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.StorageTypeT), nil
|
||||
}
|
||||
|
||||
type TitleStatusT string
|
||||
|
||||
const (
|
||||
TitleStatusTFinished TitleStatusT = "finished"
|
||||
TitleStatusTOngoing TitleStatusT = "ongoing"
|
||||
TitleStatusTPlanned TitleStatusT = "planned"
|
||||
)
|
||||
|
||||
func (e *TitleStatusT) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = TitleStatusT(s)
|
||||
case string:
|
||||
*e = TitleStatusT(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for TitleStatusT: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullTitleStatusT struct {
|
||||
TitleStatusT TitleStatusT `json:"title_status_t"`
|
||||
Valid bool `json:"valid"` // Valid is true if TitleStatusT is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullTitleStatusT) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.TitleStatusT, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.TitleStatusT.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullTitleStatusT) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.TitleStatusT), nil
|
||||
}
|
||||
|
||||
type UsertitleStatusT string
|
||||
|
||||
const (
|
||||
UsertitleStatusTFinished UsertitleStatusT = "finished"
|
||||
UsertitleStatusTPlanned UsertitleStatusT = "planned"
|
||||
UsertitleStatusTDropped UsertitleStatusT = "dropped"
|
||||
UsertitleStatusTInProgress UsertitleStatusT = "in-progress"
|
||||
)
|
||||
|
||||
func (e *UsertitleStatusT) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = UsertitleStatusT(s)
|
||||
case string:
|
||||
*e = UsertitleStatusT(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for UsertitleStatusT: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullUsertitleStatusT struct {
|
||||
UsertitleStatusT UsertitleStatusT `json:"usertitle_status_t"`
|
||||
Valid bool `json:"valid"` // Valid is true if UsertitleStatusT is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullUsertitleStatusT) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.UsertitleStatusT, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.UsertitleStatusT.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullUsertitleStatusT) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.UsertitleStatusT), nil
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
ImageID int32 `json:"image_id"`
|
||||
StorageType StorageTypeT `json:"storage_type"`
|
||||
ImagePath string `json:"image_path"`
|
||||
}
|
||||
|
||||
type Provider struct {
|
||||
ProviderID int32 `json:"provider_id"`
|
||||
ProviderName string `json:"provider_name"`
|
||||
}
|
||||
|
||||
type Review struct {
|
||||
ReviewID int32 `json:"review_id"`
|
||||
UserID int32 `json:"user_id"`
|
||||
TitleID int32 `json:"title_id"`
|
||||
ReviewText string `json:"review_text"`
|
||||
CreationDate pgtype.Timestamp `json:"creation_date"`
|
||||
}
|
||||
|
||||
type Signal struct {
|
||||
SignalID int32 `json:"signal_id"`
|
||||
RawData []byte `json:"raw_data"`
|
||||
ProviderID int32 `json:"provider_id"`
|
||||
Dirty bool `json:"dirty"`
|
||||
}
|
||||
|
||||
type Studio struct {
|
||||
StudioID int32 `json:"studio_id"`
|
||||
StudioName *string `json:"studio_name"`
|
||||
IllustID *int32 `json:"illust_id"`
|
||||
StudioDesc *string `json:"studio_desc"`
|
||||
}
|
||||
|
||||
type Tag struct {
|
||||
TagID int32 `json:"tag_id"`
|
||||
TagNames []byte `json:"tag_names"`
|
||||
}
|
||||
|
||||
type Title struct {
|
||||
TitleID int32 `json:"title_id"`
|
||||
TitleNames []byte `json:"title_names"`
|
||||
StudioID int32 `json:"studio_id"`
|
||||
PosterID *int32 `json:"poster_id"`
|
||||
TitleStatus TitleStatusT `json:"title_status"`
|
||||
Rating *float64 `json:"rating"`
|
||||
RatingCount *int32 `json:"rating_count"`
|
||||
ReleaseYear *int32 `json:"release_year"`
|
||||
ReleaseSeason NullReleaseSeasonT `json:"release_season"`
|
||||
Season *int32 `json:"season"`
|
||||
EpisodesAired *int32 `json:"episodes_aired"`
|
||||
EpisodesAll *int32 `json:"episodes_all"`
|
||||
EpisodesLen []byte `json:"episodes_len"`
|
||||
}
|
||||
|
||||
type TitleTag struct {
|
||||
TitleID int32 `json:"title_id"`
|
||||
TagID int32 `json:"tag_id"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
UserID int32 `json:"user_id"`
|
||||
AvatarID *int32 `json:"avatar_id"`
|
||||
Passhash string `json:"passhash"`
|
||||
Mail *string `json:"mail"`
|
||||
Nickname string `json:"nickname"`
|
||||
DispName *string `json:"disp_name"`
|
||||
UserDesc *string `json:"user_desc"`
|
||||
CreationDate pgtype.Timestamp `json:"creation_date"`
|
||||
}
|
||||
|
||||
type Usertitle struct {
|
||||
UsertitleID int32 `json:"usertitle_id"`
|
||||
UserID int32 `json:"user_id"`
|
||||
TitleID int32 `json:"title_id"`
|
||||
Status UsertitleStatusT `json:"status"`
|
||||
Rate *int32 `json:"rate"`
|
||||
ReviewID *int32 `json:"review_id"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue