2025-01-26 20:39:19 +00:00
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
// versions:
|
|
|
|
// sqlc v1.28.0
|
|
|
|
|
|
|
|
package dbq
|
|
|
|
|
2025-01-27 03:23:54 +00:00
|
|
|
import (
|
|
|
|
"database/sql/driver"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PostState string
|
|
|
|
|
|
|
|
const (
|
|
|
|
PostStateDraft PostState = "draft"
|
|
|
|
PostStatePublished PostState = "published"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *PostState) Scan(src interface{}) error {
|
|
|
|
switch s := src.(type) {
|
|
|
|
case []byte:
|
|
|
|
*e = PostState(s)
|
|
|
|
case string:
|
|
|
|
*e = PostState(s)
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported scan type for PostState: %T", src)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type NullPostState struct {
|
|
|
|
PostState PostState
|
|
|
|
Valid bool // Valid is true if PostState is not NULL
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan implements the Scanner interface.
|
|
|
|
func (ns *NullPostState) Scan(value interface{}) error {
|
|
|
|
if value == nil {
|
|
|
|
ns.PostState, ns.Valid = "", false
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ns.Valid = true
|
|
|
|
return ns.PostState.Scan(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value implements the driver Valuer interface.
|
|
|
|
func (ns NullPostState) Value() (driver.Value, error) {
|
|
|
|
if !ns.Valid {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return string(ns.PostState), nil
|
|
|
|
}
|
|
|
|
|
2025-01-27 04:45:53 +00:00
|
|
|
type TargetRole string
|
|
|
|
|
|
|
|
const (
|
|
|
|
TargetRoleProduction TargetRole = "production"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *TargetRole) Scan(src interface{}) error {
|
|
|
|
switch s := src.(type) {
|
|
|
|
case []byte:
|
|
|
|
*e = TargetRole(s)
|
|
|
|
case string:
|
|
|
|
*e = TargetRole(s)
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported scan type for TargetRole: %T", src)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type NullTargetRole struct {
|
|
|
|
TargetRole TargetRole
|
|
|
|
Valid bool // Valid is true if TargetRole is not NULL
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan implements the Scanner interface.
|
|
|
|
func (ns *NullTargetRole) Scan(value interface{}) error {
|
|
|
|
if value == nil {
|
|
|
|
ns.TargetRole, ns.Valid = "", false
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ns.Valid = true
|
|
|
|
return ns.TargetRole.Scan(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value implements the driver Valuer interface.
|
|
|
|
func (ns NullTargetRole) Value() (driver.Value, error) {
|
|
|
|
if !ns.Valid {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return string(ns.TargetRole), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type TargetType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
TargetTypeNetlify TargetType = "netlify"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *TargetType) Scan(src interface{}) error {
|
|
|
|
switch s := src.(type) {
|
|
|
|
case []byte:
|
|
|
|
*e = TargetType(s)
|
|
|
|
case string:
|
|
|
|
*e = TargetType(s)
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported scan type for TargetType: %T", src)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type NullTargetType struct {
|
|
|
|
TargetType TargetType
|
|
|
|
Valid bool // Valid is true if TargetType is not NULL
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan implements the Scanner interface.
|
|
|
|
func (ns *NullTargetType) Scan(value interface{}) error {
|
|
|
|
if value == nil {
|
|
|
|
ns.TargetType, ns.Valid = "", false
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ns.Valid = true
|
|
|
|
return ns.TargetType.Scan(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value implements the driver Valuer interface.
|
|
|
|
func (ns NullTargetType) Value() (driver.Value, error) {
|
|
|
|
if !ns.Valid {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return string(ns.TargetType), nil
|
|
|
|
}
|
|
|
|
|
2025-01-27 03:23:54 +00:00
|
|
|
type Post struct {
|
|
|
|
ID int64
|
|
|
|
SiteID int64
|
|
|
|
Title pgtype.Text
|
|
|
|
Body string
|
|
|
|
State PostState
|
|
|
|
Props []byte
|
|
|
|
PostDate pgtype.Timestamptz
|
|
|
|
CreatedAt pgtype.Timestamp
|
|
|
|
}
|
|
|
|
|
2025-01-27 04:45:53 +00:00
|
|
|
type PublishTarget struct {
|
|
|
|
ID int64
|
|
|
|
SiteID int64
|
|
|
|
Role TargetRole
|
|
|
|
TargetType TargetType
|
|
|
|
Url string
|
|
|
|
TargetRef string
|
|
|
|
}
|
|
|
|
|
2025-01-26 20:39:19 +00:00
|
|
|
type Site struct {
|
|
|
|
ID int64
|
|
|
|
Name string
|
2025-01-26 23:19:31 +00:00
|
|
|
Title string
|
2025-01-26 20:39:19 +00:00
|
|
|
Url string
|
|
|
|
Theme string
|
|
|
|
Props []byte
|
|
|
|
}
|