238 lines
5.2 KiB
Go
238 lines
5.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package db
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type AttachmentContentType string
|
|
|
|
const (
|
|
AttachmentContentTypeImagePng AttachmentContentType = "image/png"
|
|
AttachmentContentTypeImageJpeg AttachmentContentType = "image/jpeg"
|
|
)
|
|
|
|
func (e *AttachmentContentType) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AttachmentContentType(s)
|
|
case string:
|
|
*e = AttachmentContentType(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AttachmentContentType: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAttachmentContentType struct {
|
|
AttachmentContentType AttachmentContentType
|
|
Valid bool // Valid is true if AttachmentContentType is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAttachmentContentType) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AttachmentContentType, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AttachmentContentType.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAttachmentContentType) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AttachmentContentType), nil
|
|
}
|
|
|
|
type AttachmentStatus string
|
|
|
|
const (
|
|
AttachmentStatusQueued AttachmentStatus = "queued"
|
|
AttachmentStatusProcessing AttachmentStatus = "processing"
|
|
AttachmentStatusReady AttachmentStatus = "ready"
|
|
AttachmentStatusFailed AttachmentStatus = "failed"
|
|
)
|
|
|
|
func (e *AttachmentStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AttachmentStatus(s)
|
|
case string:
|
|
*e = AttachmentStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AttachmentStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAttachmentStatus struct {
|
|
AttachmentStatus AttachmentStatus
|
|
Valid bool // Valid is true if AttachmentStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAttachmentStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AttachmentStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AttachmentStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAttachmentStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AttachmentStatus), nil
|
|
}
|
|
|
|
type AttachmentVariantName string
|
|
|
|
const (
|
|
AttachmentVariantNameThumbnail AttachmentVariantName = "thumbnail"
|
|
AttachmentVariantNameCrop AttachmentVariantName = "crop"
|
|
AttachmentVariantNameOptimized AttachmentVariantName = "optimized"
|
|
)
|
|
|
|
func (e *AttachmentVariantName) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = AttachmentVariantName(s)
|
|
case string:
|
|
*e = AttachmentVariantName(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for AttachmentVariantName: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullAttachmentVariantName struct {
|
|
AttachmentVariantName AttachmentVariantName
|
|
Valid bool // Valid is true if AttachmentVariantName is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullAttachmentVariantName) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.AttachmentVariantName, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.AttachmentVariantName.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullAttachmentVariantName) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.AttachmentVariantName), nil
|
|
}
|
|
|
|
type Attachment struct {
|
|
ID uuid.UUID
|
|
ChatID uuid.UUID
|
|
OwnerID uuid.UUID
|
|
S3Key string
|
|
Filename string
|
|
ContentType AttachmentContentType
|
|
SizeBytes int
|
|
Sha256 string
|
|
Status AttachmentStatus
|
|
ErrorCode *string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
StagingKey *string
|
|
JobID *uuid.UUID
|
|
PipelineVersion int
|
|
Attempts int
|
|
Width *int32
|
|
Height *int32
|
|
LeaseUntil *time.Time
|
|
}
|
|
|
|
type AttachmentVariant struct {
|
|
AttachmentID uuid.UUID
|
|
PipelineVersion int
|
|
Variant AttachmentVariantName
|
|
S3Key string
|
|
ContentType string
|
|
SizeBytes int
|
|
Sha256 string
|
|
Width int
|
|
Height int
|
|
}
|
|
|
|
type Chat struct {
|
|
ID uuid.UUID
|
|
Title string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type ChatMember struct {
|
|
ChatID uuid.UUID
|
|
UserID uuid.UUID
|
|
}
|
|
|
|
type IdempotencyKey struct {
|
|
UserID uuid.UUID
|
|
Method string
|
|
Path string
|
|
Key string
|
|
RequestHash string
|
|
MessageID uuid.UUID
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Message struct {
|
|
ID uuid.UUID
|
|
ChatID uuid.UUID
|
|
SenderID uuid.UUID
|
|
Text string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type MessageAttachment struct {
|
|
MessageID uuid.UUID
|
|
AttachmentID uuid.UUID
|
|
Position int
|
|
}
|
|
|
|
type Outbox struct {
|
|
ID int64
|
|
JobID uuid.UUID
|
|
AttachmentID uuid.UUID
|
|
PipelineVersion int
|
|
Attempt int
|
|
CreatedAt time.Time
|
|
AvailableAt time.Time
|
|
PublishedAt *time.Time
|
|
}
|
|
|
|
type Session struct {
|
|
TokenHash string
|
|
UserID uuid.UUID
|
|
CreatedAt time.Time
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
type User struct {
|
|
ID uuid.UUID
|
|
Username string
|
|
DisplayName string
|
|
PasswordHash string
|
|
CreatedAt time.Time
|
|
}
|