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"
|
|
|
|
)
|
|
|
|
|
2025-02-16 00:43:22 +00:00
|
|
|
type PageNameProvenance string
|
|
|
|
|
|
|
|
const (
|
|
|
|
PageNameProvenanceUser PageNameProvenance = "user"
|
|
|
|
PageNameProvenanceTitle PageNameProvenance = "title"
|
|
|
|
PageNameProvenanceDate PageNameProvenance = "date"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *PageNameProvenance) Scan(src interface{}) error {
|
|
|
|
switch s := src.(type) {
|
|
|
|
case []byte:
|
|
|
|
*e = PageNameProvenance(s)
|
|
|
|
case string:
|
|
|
|
*e = PageNameProvenance(s)
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported scan type for PageNameProvenance: %T", src)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type NullPageNameProvenance struct {
|
|
|
|
PageNameProvenance PageNameProvenance
|
|
|
|
Valid bool // Valid is true if PageNameProvenance is not NULL
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan implements the Scanner interface.
|
|
|
|
func (ns *NullPageNameProvenance) Scan(value interface{}) error {
|
|
|
|
if value == nil {
|
|
|
|
ns.PageNameProvenance, ns.Valid = "", false
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ns.Valid = true
|
|
|
|
return ns.PageNameProvenance.Scan(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value implements the driver Valuer interface.
|
|
|
|
func (ns NullPageNameProvenance) Value() (driver.Value, error) {
|
|
|
|
if !ns.Valid {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return string(ns.PageNameProvenance), nil
|
|
|
|
}
|
|
|
|
|
2025-02-16 03:06:45 +00:00
|
|
|
type PageRole string
|
|
|
|
|
|
|
|
const (
|
|
|
|
PageRoleIndex PageRole = "index"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *PageRole) Scan(src interface{}) error {
|
|
|
|
switch s := src.(type) {
|
|
|
|
case []byte:
|
|
|
|
*e = PageRole(s)
|
|
|
|
case string:
|
|
|
|
*e = PageRole(s)
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("unsupported scan type for PageRole: %T", src)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type NullPageRole struct {
|
|
|
|
PageRole PageRole
|
|
|
|
Valid bool // Valid is true if PageRole is not NULL
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan implements the Scanner interface.
|
|
|
|
func (ns *NullPageRole) Scan(value interface{}) error {
|
|
|
|
if value == nil {
|
|
|
|
ns.PageRole, ns.Valid = "", false
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ns.Valid = true
|
|
|
|
return ns.PageRole.Scan(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value implements the driver Valuer interface.
|
|
|
|
func (ns NullPageRole) Value() (driver.Value, error) {
|
|
|
|
if !ns.Valid {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return string(ns.PageRole), nil
|
|
|
|
}
|
|
|
|
|
2025-01-27 03:23:54 +00:00
|
|
|
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-02-16 00:43:22 +00:00
|
|
|
type Bundle struct {
|
2025-01-27 03:23:54 +00:00
|
|
|
ID int64
|
|
|
|
SiteID int64
|
2025-02-16 00:43:22 +00:00
|
|
|
Name string
|
2025-01-27 03:23:54 +00:00
|
|
|
CreatedAt pgtype.Timestamp
|
2025-02-16 00:43:22 +00:00
|
|
|
UpdatedAt pgtype.Timestamp
|
|
|
|
}
|
|
|
|
|
|
|
|
type Page struct {
|
|
|
|
ID int64
|
|
|
|
SiteID int64
|
|
|
|
BundleID int64
|
|
|
|
Name string
|
|
|
|
NameProvenance PageNameProvenance
|
|
|
|
Title pgtype.Text
|
2025-02-16 03:06:45 +00:00
|
|
|
PostTypeID pgtype.Int8
|
2025-02-16 00:43:22 +00:00
|
|
|
Body string
|
|
|
|
State PostState
|
|
|
|
Props []byte
|
2025-02-16 03:06:45 +00:00
|
|
|
Role NullPageRole
|
2025-02-16 00:43:22 +00:00
|
|
|
PublishDate pgtype.Timestamptz
|
|
|
|
CreatedAt pgtype.Timestamp
|
|
|
|
UpdatedAt pgtype.Timestamp
|
|
|
|
}
|
|
|
|
|
|
|
|
type Post struct {
|
|
|
|
ID int64
|
|
|
|
SiteID int64
|
|
|
|
Title pgtype.Text
|
2025-02-16 03:06:45 +00:00
|
|
|
PostTypeID pgtype.Int8
|
2025-02-16 00:43:22 +00:00
|
|
|
Body string
|
|
|
|
State PostState
|
|
|
|
Props []byte
|
|
|
|
PublishDate pgtype.Timestamptz
|
|
|
|
CreatedAt pgtype.Timestamp
|
|
|
|
UpdatedAt pgtype.Timestamp
|
|
|
|
}
|
|
|
|
|
2025-02-16 03:06:45 +00:00
|
|
|
type PostType struct {
|
2025-02-16 00:43:22 +00:00
|
|
|
ID int64
|
|
|
|
SiteID int64
|
|
|
|
LayoutName string
|
2025-01-27 03:23:54 +00:00
|
|
|
}
|
|
|
|
|
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 {
|
2025-01-31 22:42:32 +00:00
|
|
|
ID int64
|
|
|
|
OwnerUserID int64
|
|
|
|
Name string
|
|
|
|
Title string
|
|
|
|
Theme string
|
|
|
|
Props []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
ID int64
|
|
|
|
Email string
|
|
|
|
Password string
|
2025-01-26 20:39:19 +00:00
|
|
|
}
|