// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.29.0 package nimdb import ( "database/sql/driver" "fmt" "github.com/jackc/pgx/v5/pgtype" ) type PostPhase string const ( PostPhasePending PostPhase = "pending" PostPhaseRejected PostPhase = "rejected" PostPhaseAdminRejected PostPhase = "admin_rejected" PostPhaseOk PostPhase = "ok" PostPhaseDeleted PostPhase = "deleted" ) func (e *PostPhase) Scan(src interface{}) error { switch s := src.(type) { case []byte: *e = PostPhase(s) case string: *e = PostPhase(s) default: return fmt.Errorf("unsupported scan type for PostPhase: %T", src) } return nil } type NullPostPhase struct { PostPhase PostPhase Valid bool // Valid is true if PostPhase is not NULL } // Scan implements the Scanner interface. func (ns *NullPostPhase) Scan(value interface{}) error { if value == nil { ns.PostPhase, ns.Valid = "", false return nil } ns.Valid = true return ns.PostPhase.Scan(value) } // Value implements the driver Valuer interface. func (ns NullPostPhase) Value() (driver.Value, error) { if !ns.Valid { return nil, nil } return string(ns.PostPhase), nil } type Admin struct { Username string Password string Totp string Super bool } type Comment struct { ID int32 PostID int32 Content string Signing pgtype.Text Hash string PostAt pgtype.Timestamptz Heart int32 } type Medium struct { Url string PostID pgtype.Int4 CommentID pgtype.Int4 Visible pgtype.Bool } type Post struct { ID int32 Content string Signing pgtype.Text Hash string PostAt pgtype.Timestamptz Heart int32 Phase PostPhase Igid pgtype.Text }