store

package
v0.0.0-...-bcbbb37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANALYTICS_VIEW_metric_BOOK    int16 = 0
	ANALYTICS_VIEW_metric_CHAPTER int16 = 1
)

Variables

View Source
var ErrNoRows = pgx.ErrNoRows

Functions

func Connect

func Connect(ctx context.Context, connectionString string) (*pgxpool.Pool, error)

func CountBooks

func CountBooks(ctx context.Context, db DBTX, req BookSearchRequest, limit uint) (int64, error)

func CountTags

func CountTags(
	ctx context.Context,
	db DBTX,
	req ListTagsQuery,
) (int64, error)

func CountUsers

func CountUsers(ctx context.Context, db DBTX, req *UsersQuery) (int64, error)

func PGArrayExpr

func PGArrayExpr[T any](arr []T) goqu.Expression

PGArrayExpr takes a slice of items and returns a literal expression with a Postgres array that can be used by goqu. It does this by using goqu natively and then manipulating the string to surround it in an array literal.

To use this in a struct, you can do something like:

type MyModel struct {
  Tags   []string        `json:"tags" db:"-"`
  DbTags goqu.Expression `json:"-" db:"tags"`
}
body := `{"tags":["x", "y"]}`
m := MyModel{}
_ = json.Unmarshal([]byte(body), &m)
m.DbTags = goqux.PGArrayExpr(m.Tags)
sql, _, _ := goqu.Insert("modeltable").Rows(m).ToSQL()

Types

type AgeRating

type AgeRating string
const (
	AgeRatingValue0 AgeRating = "?"
	AgeRatingG      AgeRating = "G"
	AgeRatingPG     AgeRating = "PG"
	AgeRatingPG13   AgeRating = "PG-13"
	AgeRatingR      AgeRating = "R"
	AgeRatingNC17   AgeRating = "NC-17"
)

func (*AgeRating) Scan

func (e *AgeRating) Scan(src interface{}) error

type Analytics_GetEventsParams

type Analytics_GetEventsParams struct {
	ID    int64
	Limit int32
}

type Analytics_GetMetricValueParams

type Analytics_GetMetricValueParams struct {
	BucketType OlAnalyticsBucketPeriodType
	BookID     int64
	Metric     string
}

type Analytics_GetMetricValueRow

type Analytics_GetMetricValueRow struct {
	SamplesCount int64
	ValueSum     float64
}

type Analytics_GetMetricValuesParams

type Analytics_GetMetricValuesParams struct {
	Metric  string
	BookIds []int64
}

type Analytics_GetMetricValuesRow

type Analytics_GetMetricValuesRow struct {
	BookID       int64
	Metric       string
	BucketType   OlAnalyticsBucketPeriodType
	SamplesCount int64
	ValueSum     float64
}

type Analytics_GetTopBooksBySamplesCountParams

type Analytics_GetTopBooksBySamplesCountParams struct {
	BucketType  OlAnalyticsBucketPeriodType
	Metric      string
	BucketStart pgtype.Timestamptz
	Skip        int32
	Limit       int32
}

type Analytics_GetTopBooksBySamplesCountRow

type Analytics_GetTopBooksBySamplesCountRow struct {
	BookID       int64
	SamplesCount int64
	ValueSum     float64
}

type Analytics_GetTopBooksByValueSumParams

type Analytics_GetTopBooksByValueSumParams struct {
	BucketType  OlAnalyticsBucketPeriodType
	Metric      string
	BucketStart pgtype.Timestamptz
	Skip        int32
	Limit       int32
}

type Analytics_GetTopBooksByValueSumRow

type Analytics_GetTopBooksByValueSumRow struct {
	BookID       int64
	SamplesCount int64
	ValueSum     float64
}

type Analytics_InsertEventParams

type Analytics_InsertEventParams struct {
	UserKey   string
	BookID    int64
	EventType string
	Value     float64
	CreatedAt pgtype.Timestamptz
}

type Analytics_RecalculateBookPopularityParams

type Analytics_RecalculateBookPopularityParams struct {
	BucketType  OlAnalyticsBucketPeriodType
	BucketStart pgtype.Timestamptz
	Weights     []byte
}

type Analytics_SetWorkerStateParams

type Analytics_SetWorkerStateParams struct {
	WorkerName string
	LastLaunch pgtype.Timestamptz
	LastCursor int64
}

type Analytics_UpdateMetricsParams

type Analytics_UpdateMetricsParams struct {
	BookIds  []int64
	Metrics  []string
	Values   []float64
	Samples  []int64
	DayStart pgtype.Timestamptz
}

type Book

type Book struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
}

type BookChapter

type BookChapter struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	Summary           string
	Fonts             []string
	IsPubliclyVisible bool
}

type BookSearchFilter

type BookSearchFilter struct {
	Query string

	Words           Int4Range
	WordsPerChapter Int4Range
	Chapters        Int4Range

	IncludeAuthors []pgtype.UUID
	ExcludeAuthors []pgtype.UUID

	IncludeParentTags []int64
	ExcludeParentTags []int64

	IncludeBanned bool
	IncludeHidden bool
	IncludeEmpty  bool
}

type BookSearchRequest

type BookSearchRequest struct {
	BookSearchFilter
	Page     uint
	PageSize uint
}

type BookSearchRow

type BookSearchRow struct {
	ID                 int64              `db:"id"`
	Name               string             `db:"name"`
	Summary            string             `db:"summary"`
	CreatedAt          pgtype.Timestamptz `db:"created_at"`
	AgeRating          AgeRating          `db:"age_rating"`
	Words              int                `db:"words"`
	Chapters           int                `db:"chapters"`
	TagIds             []int64            `db:"tag_ids"`
	CachedParentTagIds []int64            `db:"cached_parent_tag_ids"`
	AuthorUserID       pgtype.UUID        `db:"author_user_id"`
	AuthorName         string             `db:"author_name"`
	HasCover           bool               `db:"has_cover"`
}

func SearchBooks

func SearchBooks(ctx context.Context, db DBTX, req BookSearchRequest) ([]BookSearchRow, error)

type BookSetCoverParams

type BookSetCoverParams struct {
	ID    int64
	Cover string
}

type BookStats

type BookStats struct {
	ChaptersMin        int64 `db:"chapters_min"`
	ChaptersMax        int64 `db:"chapters_max"`
	WordsMin           int64 `db:"words_min"`
	WordsMax           int64 `db:"words_max"`
	WordsPerChapterMin int64 `db:"words_per_chapter_min"`
	WordsPerChapterMax int64 `db:"words_per_chapter_max"`
	FavoritesMin       int64 `db:"favorites_min"`
	FavoritesMax       int64 `db:"favorites_max"`
}

func GetBooksFilterExtremes

func GetBooksFilterExtremes(ctx context.Context, db DBTX, req *BookSearchFilter) (BookStats, error)

type Book_Book_ManagerGetUserBooksCountParams

type Book_Book_ManagerGetUserBooksCountParams struct {
	AuthorUserID pgtype.UUID
	Search       string
}

type Book_GetByIdsRow

type Book_GetByIdsRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
	AuthorName         string
}

type Book_GetByUserParams

type Book_GetByUserParams struct {
	AuthorUserID pgtype.UUID
	Limit        int32
	Offset       int32
}

type Book_GetChapterOrderRow

type Book_GetChapterOrderRow struct {
	Order int32
	ID    int64
}

type Book_GetPubliclyVisibleChaptersRow

type Book_GetPubliclyVisibleChaptersRow struct {
	ID        int64
	Name      string
	Words     int32
	Order     int32
	CreatedAt pgtype.Timestamptz
	Summary   string
}

type Book_GetRow

type Book_GetRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
	AuthorName         string
}

type Book_InsertChapterParams

type Book_InsertChapterParams struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	Order             int32
	CreatedAt         pgtype.Timestamptz
	Words             int32
	Summary           string
	Fonts             []string
	IsPubliclyVisible bool
}

type Book_InsertParams

type Book_InsertParams struct {
	ID                 int64
	Name               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	TagIds             []int64
	CachedParentTagIds []int64
	IsPubliclyVisible  bool
	Slug               string
}

type Book_ManagerGetUserBooksParams

type Book_ManagerGetUserBooksParams struct {
	Limit        int32
	Offset       int32
	AuthorUserID pgtype.UUID
	Search       string
}

type Book_ManagerGetUserBooksRow

type Book_ManagerGetUserBooksRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
	CollectionID       pgtype.Int8
	CollectionName     pgtype.Text
	CollectionPosition pgtype.Int4
	CollectionSize     pgtype.Int4
}

type Book_SetChapterOrderParams

type Book_SetChapterOrderParams struct {
	ID    int64
	Order int32
}

type Book_UnTrashParams

type Book_UnTrashParams struct {
	ID                int64
	IsPubliclyVisible bool
}

type Book_UpdateParams

type Book_UpdateParams struct {
	ID                 int64
	Name               string
	AgeRating          AgeRating
	TagIds             []int64
	CachedParentTagIds []int64
	Summary            string
	IsPubliclyVisible  bool
}

type CLI_Util_MinifyContent_ListBookSummariesParams

type CLI_Util_MinifyContent_ListBookSummariesParams struct {
	ID    int64
	Limit int32
}

type CLI_Util_MinifyContent_ListBookSummariesRow

type CLI_Util_MinifyContent_ListBookSummariesRow struct {
	ID      int64
	Summary string
}

type CLI_Util_MinifyContent_ListChaptersParams

type CLI_Util_MinifyContent_ListChaptersParams struct {
	ID    int64
	Limit int32
}

type CLI_Util_MinifyContent_ListChaptersRow

type CLI_Util_MinifyContent_ListChaptersRow struct {
	ID      int64
	Content string
	Words   int32
}

type CLI_Util_MinifyContent_UpdateBookSummaryParams

type CLI_Util_MinifyContent_UpdateBookSummaryParams struct {
	ID      int64
	Summary string
}

type CLI_Util_MinifyContent_UpdateChapterParams

type CLI_Util_MinifyContent_UpdateChapterParams struct {
	ID      int64
	Content string
	Words   int32
}

type CensorMode

type CensorMode string
const (
	CensorModeHide   CensorMode = "hide"
	CensorModeCensor CensorMode = "censor"
	CensorModeNone   CensorMode = "none"
)

func (*CensorMode) Scan

func (e *CensorMode) Scan(src interface{}) error

type Chapter_UpdateDetailsParams

type Chapter_UpdateDetailsParams struct {
	Name              string
	Summary           string
	IsPubliclyVisible bool
	ChapterID         int64
	BookID            int64
	UserID            pgtype.UUID
}

type Chapter_UpdateParams

type Chapter_UpdateParams struct {
	ID                int64
	Name              string
	Content           string
	Words             int32
	Summary           string
	IsPubliclyVisible bool
	ContentUpdatedAt  pgtype.Timestamptz
	Fonts             []string
}

type Chapter_UserCanEditParams

type Chapter_UserCanEditParams struct {
	ChapterID int64
	BookID    int64
	UserID    pgtype.UUID
}

type Collection

type Collection struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
}

type CollectionBook

type CollectionBook struct {
	CollectionID int64
	BookID       int64
	AddedAt      pgtype.Timestamptz
	Order        int32
}

type Collection_AddBookToCollectionParams

type Collection_AddBookToCollectionParams struct {
	BookID       int64
	CollectionID int64
}

type Collection_DeleteBookFromCollectionParams

type Collection_DeleteBookFromCollectionParams struct {
	BookID       int64
	CollectionID int64
}

type Collection_GetBooksParams

type Collection_GetBooksParams struct {
	Limit        int32
	Offset       int32
	CollectionID int64
}

type Collection_GetBooksRow

type Collection_GetBooksRow struct {
	ID                    int64
	Name                  string
	Slug                  string
	Summary               string
	AuthorUserID          pgtype.UUID
	CreatedAt             pgtype.Timestamptz
	AgeRating             AgeRating
	IsPubliclyVisible     bool
	IsBanned              bool
	IsTrashed             bool
	Words                 int32
	Chapters              int32
	TagIds                []int64
	CachedParentTagIds    []int64
	Cover                 string
	View                  int32
	Rating                pgtype.Float8
	TotalReviews          int32
	TotalRatings          int32
	IsPinned              bool
	IsPermRemoved         bool
	IsShadowBanned        bool
	AuthorName            string
	OrderWithinCollection int32
}

type Collection_GetByBookParams

type Collection_GetByBookParams struct {
	UserID pgtype.UUID
	BookID int64
}

type Collection_GetByBookRow

type Collection_GetByBookRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_GetByUserParams

type Collection_GetByUserParams struct {
	Limit  int32
	Offset int32
	UserID pgtype.UUID
}

type Collection_GetByUserRow

type Collection_GetByUserRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_GetRecentByUserParams

type Collection_GetRecentByUserParams struct {
	UserID pgtype.UUID
	Limit  int32
}

type Collection_GetRow

type Collection_GetRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_InsertParams

type Collection_InsertParams struct {
	ID     int64
	Name   string
	Slug   string
	UserID pgtype.UUID
}

type Collection_UpdateParams

type Collection_UpdateParams struct {
	ID      int64
	Name    string
	Summary string
	Slug    string
}

type Comment

type Comment struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
}

type Comment_GetByChapterAfterParams

type Comment_GetByChapterAfterParams struct {
	ChapterID int64
	Limit     int32
	CreatedAt pgtype.Timestamptz
}

type Comment_GetByChapterAfterRow

type Comment_GetByChapterAfterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetByChapterParams

type Comment_GetByChapterParams struct {
	ChapterID  int64
	Sort       string
	PageOffset int32
	PageLimit  int32
}

type Comment_GetByChapterRow

type Comment_GetByChapterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetChildCommentsAfterParams

type Comment_GetChildCommentsAfterParams struct {
	Limit     int32
	CreatedAt pgtype.Timestamptz
	ParentID  int64
}

type Comment_GetChildCommentsAfterRow

type Comment_GetChildCommentsAfterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetChildCommentsParams

type Comment_GetChildCommentsParams struct {
	Limit    int32
	ParentID int64
}

type Comment_GetChildCommentsRow

type Comment_GetChildCommentsRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetLikedCommentsParams

type Comment_GetLikedCommentsParams struct {
	UserID pgtype.UUID
	Ids    []int64
}

type Comment_GetLikedCommentsRow

type Comment_GetLikedCommentsRow struct {
	CommentID int64
	LikedAt   pgtype.Timestamptz
}

type Comment_GetWithUserByIDRow

type Comment_GetWithUserByIDRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_InsertParams

type Comment_InsertParams struct {
	ID        int64
	ChapterID int64
	ParentID  pgtype.Int8
	UserID    pgtype.UUID
	Content   string
}

type Comment_LikeParams

type Comment_LikeParams struct {
	CommentID int64
	UserID    pgtype.UUID
}

type Comment_UnLikeParams

type Comment_UnLikeParams struct {
	CommentID int64
	UserID    pgtype.UUID
}

type Comment_UpdateParams

type Comment_UpdateParams struct {
	ID      int64
	Content string
	UserID  pgtype.UUID
}

type CommentsLiked

type CommentsLiked struct {
	CommentID int64
	UserID    pgtype.UUID
	LikedAt   pgtype.Timestamptz
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type DefinedTag

type DefinedTag struct {
	ID             int64
	Name           string
	Description    string
	IsSpoiler      bool
	IsAdult        bool
	CreatedAt      pgtype.Timestamptz
	TagType        TagType
	SynonymOf      pgtype.Int8
	IsDefault      bool
	LowercasedName string
}

type DeleteRateParams

type DeleteRateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type DeleteReviewParams

type DeleteReviewParams struct {
	UserID pgtype.UUID
	BookID int64
}

type DeleteUserFollowParams

type DeleteUserFollowParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type Draft

type Draft struct {
	ID          int64
	CreatedBy   pgtype.UUID
	ChapterID   int64
	ChapterName string
	Content     string
	Words       int32
	Summary     string
	UpdatedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	PublishedAt pgtype.Timestamptz
	ScheduledAt pgtype.Timestamptz
}

type DraftLog

type DraftLog struct {
	ID        int64
	DraftID   int64
	CreatedAt pgtype.Timestamptz
	UserID    pgtype.UUID
	Payload   []byte
}

type Draft_GetByIdRow

type Draft_GetByIdRow struct {
	ID                       int64
	CreatedBy                pgtype.UUID
	ChapterID                int64
	ChapterName              string
	Content                  string
	Words                    int32
	Summary                  string
	UpdatedAt                pgtype.Timestamptz
	CreatedAt                pgtype.Timestamptz
	PublishedAt              pgtype.Timestamptz
	ScheduledAt              pgtype.Timestamptz
	BookID                   int64
	BookName                 string
	IsChapterPubliclyVisible bool
	ChapterContentUpdatedAt  pgtype.Timestamptz
	ChapterFonts             []string
}

type Draft_InsertParams

type Draft_InsertParams struct {
	ID          int64
	CreatedBy   pgtype.UUID
	ChapterID   int64
	ChapterName string
	Content     string
	UpdatedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
}

type Draft_ScheduleParams

type Draft_ScheduleParams struct {
	ID          int64
	ScheduledAt pgtype.Timestamptz
}

type Draft_UpdateChapterNameParams

type Draft_UpdateChapterNameParams struct {
	ID          int64
	ChapterName string
}

type Draft_UpdateContentParams

type Draft_UpdateContentParams struct {
	ID      int64
	Content string
	Words   int32
}

type Draft_UpdateParams

type Draft_UpdateParams struct {
	ID          int64
	ChapterName string
	Words       int32
	Content     string
	Summary     string
}

type Draft_UserCanAccessParams

type Draft_UserCanAccessParams struct {
	DraftID   int64
	UserID    pgtype.UUID
	ChapterID int64
	BookID    int64
}

type EmailVerification

type EmailVerification struct {
	Email                string
	UserID               pgtype.UUID
	VerificationCodeHash string
	CreatedAt            pgtype.Timestamptz
	ValidThrough         pgtype.Timestamptz
}

type EmailVerification_InsertParams

type EmailVerification_InsertParams struct {
	Email                string
	UserID               pgtype.UUID
	ValidThrough         pgtype.Timestamptz
	VerificationCodeHash string
}

type GetAllBookChaptersRow

type GetAllBookChaptersRow struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	Summary           string
	Fonts             []string
	IsPubliclyVisible bool
	LatestDraftID     int64
	ScheduledAt       pgtype.Timestamptz
}

type GetAllBooksParams

type GetAllBooksParams struct {
	ID    int64
	Limit int32
}

type GetAllBooksRow

type GetAllBooksRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	CachedParentTagIds []int64
	IsPubliclyVisible  bool
	IsTrashed          bool
	Chapters           int32
	Words              int32
}

type GetBookChapterWithDetailsParams

type GetBookChapterWithDetailsParams struct {
	ID     int64
	BookID int64
}

type GetBookChapterWithDetailsRow

type GetBookChapterWithDetailsRow struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	Summary           string
	Fonts             []string
	IsPubliclyVisible bool
	PrevChapterID     int64
	PrevChapterName   string
	NextChapterID     int64
	NextChapterName   string
}

type GetBookCollectionDataRow

type GetBookCollectionDataRow struct {
	ID        int64
	Name      string
	Size      int32
	Position  int32
	CreatedAt pgtype.Timestamptz
	UserName  string
	UserID    pgtype.UUID
}

type GetBookReadingListStateParams

type GetBookReadingListStateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type GetBookReadingListStateRow

type GetBookReadingListStateRow struct {
	UserID                pgtype.UUID
	BookID                int64
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
	LastUpdatedAt         pgtype.Timestamptz
	ChapterOrder          pgtype.Int4
	ChapterName           pgtype.Text
}

type GetBookReviewsDistributionRow

type GetBookReviewsDistributionRow struct {
	Rating int16
	Count  int64
}

type GetBookReviewsParams

type GetBookReviewsParams struct {
	BookID int64
	Offset int32
	Limit  int32
}

type GetBookReviewsRow

type GetBookReviewsRow struct {
	UserID          pgtype.UUID
	BookID          int64
	Content         string
	CreatedAt       pgtype.Timestamptz
	LastUpdatedAt   pgtype.Timestamptz
	Likes           int32
	Rating          int16
	RatingUpdatedAt pgtype.Timestamptz
	UserName        string
}

type GetBookSearchRelatedDataRow

type GetBookSearchRelatedDataRow struct {
	CreatedAt pgtype.Timestamptz
	Cover     string
	ID        int64
}

type GetBooksCollectionDataRow

type GetBooksCollectionDataRow struct {
	ID        int64
	Name      string
	Size      int32
	BookID    int64
	Position  int32
	CreatedAt pgtype.Timestamptz
	UserName  string
	UserID    pgtype.UUID
}

type GetRateParams

type GetRateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type GetRatingParams

type GetRatingParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetReviewAndRatingParams

type GetReviewAndRatingParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetReviewAndRatingRow

type GetReviewAndRatingRow struct {
	UserID          pgtype.UUID
	BookID          int64
	Content         string
	CreatedAt       pgtype.Timestamptz
	LastUpdatedAt   pgtype.Timestamptz
	Likes           int32
	Rating          int16
	RatingUpdatedAt pgtype.Timestamptz
}

type GetReviewParams

type GetReviewParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetTagRow

type GetTagRow struct {
	ID             int64
	Name           string
	Description    string
	IsSpoiler      bool
	IsAdult        bool
	CreatedAt      pgtype.Timestamptz
	TagType        TagType
	SynonymOf      pgtype.Int8
	IsDefault      bool
	LowercasedName string
	SynonymName    pgtype.Text
}

type GetTopUserBooksParams

type GetTopUserBooksParams struct {
	AuthorUserID pgtype.UUID
	Limit        int32
}

type GetUserLibraryParams

type GetUserLibraryParams struct {
	UserID pgtype.UUID
	Status ReadingListStatus
	Limit  int32
}

type GetUserLibraryRow

type GetUserLibraryRow struct {
	ID            int64
	Name          string
	Cover         string
	AgeRating     AgeRating
	LastUpdatedAt pgtype.Timestamptz
	ChapterOrder  pgtype.Int4
	ChapterName   pgtype.Text
	ChapterID     pgtype.Int8
}

type GetUserPrivacySettingsRow

type GetUserPrivacySettingsRow struct {
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
}

type InsertDefinedTagEnMasseParams

type InsertDefinedTagEnMasseParams struct {
	ID          int64
	Name        string
	Description string
	IsSpoiler   bool
	IsAdult     bool
	CreatedAt   pgtype.Timestamptz
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type InsertDefinedTagParams

type InsertDefinedTagParams struct {
	ID          int64
	Name        string
	Description string
	IsSpoiler   bool
	IsAdult     bool
	CreatedAt   pgtype.Timestamptz
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type InsertOrUpdateRateParams

type InsertOrUpdateRateParams struct {
	BookID int64
	UserID pgtype.UUID
	Rating int16
}

type InsertOrUpdateReviewParams

type InsertOrUpdateReviewParams struct {
	UserID  pgtype.UUID
	BookID  int64
	Content string
}

type Int4Range

type Int4Range struct {
	Min pgtype.Int4
	Max pgtype.Int4
}

type ListTagsQuery

type ListTagsQuery struct {
	Query          string
	OnlyParentTags bool
	OnlyAdultTags  bool
	TagType        NullTagType
	Limit          uint
	Offset         uint
}

type ModAddBookLogParams

type ModAddBookLogParams struct {
	ID          int64
	Time        pgtype.Timestamptz
	Type        string
	TargetID    int64
	Payload     []byte
	ActorUserID pgtype.UUID
	Reason      string
}

type ModChangeBookAgeRatingParams

type ModChangeBookAgeRatingParams struct {
	ID        int64
	AgeRating AgeRating
}

type ModChangeBookSummaryParams

type ModChangeBookSummaryParams struct {
	ID      int64
	Summary string
}

type ModCountBookLogFilteredParams

type ModCountBookLogFilteredParams struct {
	BookID      int64
	ActionTypes []string
}

type ModCountBooksParams

type ModCountBooksParams struct {
	Search         string
	SearchID       pgtype.Int8
	ExactName      bool
	IncludeBanned  bool
	IncludeDeleted bool
}

type ModGetBookChaptersRow

type ModGetBookChaptersRow struct {
	ID                int64
	Name              string
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	IsPubliclyVisible bool
	HasPendingReports bool
}

type ModGetBookInfoRow

type ModGetBookInfoRow struct {
	IsBanned                  bool
	IsShadowBanned            bool
	IsPermRemoved             bool
	Name                      string
	Summary                   string
	AuthorUserID              pgtype.UUID
	AuthorUserName            string
	CreatedAt                 pgtype.Timestamptz
	AgeRating                 AgeRating
	IsPubliclyVisible         bool
	Words                     int32
	Chapters                  int32
	ReportsCount              int64
	LatestPendingReportID     int64
	LatestPendingReportNumber string
	LatestPendingReportReason string
	LatestPendingReportTime   pgtype.Timestamptz
	BanReason                 string
}

type ModGetBookLogFilteredParams

type ModGetBookLogFilteredParams struct {
	BookID      int64
	ActionTypes []string
	Offset      int32
	Limit       int32
}

type ModGetBookLogFilteredRow

type ModGetBookLogFilteredRow struct {
	ID            int64
	Time          pgtype.Timestamptz
	Type          string
	TargetType    string
	TargetID      string
	Payload       []byte
	ActorUserID   pgtype.UUID
	Reason        string
	ActorUserName string
}

type ModGetBookModStateRow

type ModGetBookModStateRow struct {
	ID             int64
	IsBanned       bool
	IsShadowBanned bool
}

type ModPermRemoveBookParams

type ModPermRemoveBookParams struct {
	ID           int64
	AuthorUserID pgtype.UUID
}

type ModSearchBooksParams

type ModSearchBooksParams struct {
	Search         string
	SearchID       pgtype.Int8
	ExactName      bool
	IncludeBanned  bool
	IncludeDeleted bool
	PageOffset     int32
	PageLimit      int32
}

type ModSearchBooksRow

type ModSearchBooksRow struct {
	ID                int64
	Name              string
	CreatedAt         pgtype.Timestamptz
	IsBanned          bool
	IsShadowBanned    bool
	IsTrashed         bool
	IsPermRemoved     bool
	IsPubliclyVisible bool
	Words             int32
	Chapters          int32
	AuthorUserID      pgtype.UUID
	AuthorUserName    string
	ReportsCount      int64
}

type ModSetBookBannedParams

type ModSetBookBannedParams struct {
	IsBanned bool
	ID       int64
}

type ModSetBookShadowBannedParams

type ModSetBookShadowBannedParams struct {
	IsShadowBanned bool
	ID             int64
}

type ModerationLog

type ModerationLog struct {
	ID          int64
	Time        pgtype.Timestamptz
	Type        string
	TargetType  string
	TargetID    string
	Payload     []byte
	ActorUserID pgtype.UUID
	Reason      string
}

type Moderation_AddLogParams

type Moderation_AddLogParams struct {
	ID          int64
	Time        pgtype.Timestamptz
	Type        string
	TargetType  string
	TargetID    string
	Payload     []byte
	ActorUserID pgtype.UUID
	Reason      string
}

type Moderation_AddUserBanParams

type Moderation_AddUserBanParams struct {
	ID             int64
	UserID         pgtype.UUID
	CreatedAt      pgtype.Timestamptz
	BannedByUserID pgtype.UUID
	Note           string
	ExpiresAt      pgtype.Timestamptz
}

type Moderation_ChangeUserAboutParams

type Moderation_ChangeUserAboutParams struct {
	ID    pgtype.UUID
	About string
}

type Moderation_CountUserLoginHistoryParams

type Moderation_CountUserLoginHistoryParams struct {
	UserIds       []pgtype.UUID
	Search        string
	DateFrom      pgtype.Timestamptz
	DateTo        pgtype.Timestamptz
	SessionStatus string
}

type Moderation_CountUsersParams

type Moderation_CountUsersParams struct {
	Search       string
	SearchID     pgtype.UUID
	BannedStatus string
	Role         string
}

type Moderation_GetAuditLogParams

type Moderation_GetAuditLogParams struct {
	TargetType string
	PageOffset int32
	PageLimit  int32
}

type Moderation_GetAuditLogRow

type Moderation_GetAuditLogRow struct {
	ID            int64
	Time          pgtype.Timestamptz
	Type          string
	TargetType    string
	TargetID      string
	Payload       []byte
	ActorUserID   pgtype.UUID
	Reason        string
	ActorUserName pgtype.Text
}

type Moderation_GetRecentLoginSessionsRow

type Moderation_GetRecentLoginSessionsRow struct {
	CreatedAt       pgtype.Timestamptz
	LocationCountry string
	LocationRegion  string
	LocationCity    string
}

type Moderation_GetUserBooksParams

type Moderation_GetUserBooksParams struct {
	UserID     pgtype.UUID
	PageOffset int32
	PageLimit  int32
}

type Moderation_GetUserBooksRow

type Moderation_GetUserBooksRow struct {
	ID                int64
	Name              string
	CreatedAt         pgtype.Timestamptz
	IsPubliclyVisible bool
	IsBanned          bool
	IsTrashed         bool
}

type Moderation_GetUserCommentsParams

type Moderation_GetUserCommentsParams struct {
	UserID     pgtype.UUID
	PageOffset int32
	PageLimit  int32
}

type Moderation_GetUserCommentsRow

type Moderation_GetUserCommentsRow struct {
	ID          int64
	Content     string
	CreatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	ChapterID   int64
	ChapterName string
	BookID      int64
	BookName    string
}

type Moderation_GetUserHistoryParams

type Moderation_GetUserHistoryParams struct {
	UserID     pgtype.UUID
	PageOffset int32
	PageLimit  int32
}

type Moderation_GetUserHistoryRow

type Moderation_GetUserHistoryRow struct {
	ID            int64
	Time          pgtype.Timestamptz
	Type          string
	TargetType    string
	TargetID      string
	Payload       []byte
	ActorUserID   pgtype.UUID
	Reason        string
	ActorUserName pgtype.Text
}

type Moderation_GetUserInfoRow

type Moderation_GetUserInfoRow struct {
	ID             pgtype.UUID
	Name           string
	Email          string
	About          string
	EmailVerified  bool
	JoinedAt       pgtype.Timestamptz
	Role           UserRole
	IsBanned       bool
	BooksTotal     int64
	CommentsTotal  int64
	FollowersTotal int64
}

type Moderation_GetUserLoginHistoryRow

type Moderation_GetUserLoginHistoryRow struct {
	ID        int64
	UserID    pgtype.UUID
	CreatedAt pgtype.Timestamptz
	UserAgent string
	IpAddress string
}

type Moderation_GetUserReportsParams

type Moderation_GetUserReportsParams struct {
	UserID     pgtype.UUID
	PageOffset int32
	PageLimit  int32
}

type Moderation_GetUserReportsRow

type Moderation_GetUserReportsRow struct {
	ID               int64
	Number           string
	Time             pgtype.Timestamptz
	ReporterUserID   pgtype.UUID
	TargetType       string
	TargetID         string
	Reason           string
	Description      string
	BookChapterID    pgtype.Int8
	BookExcerpt      string
	Status           string
	Priority         string
	ReporterUserName pgtype.Text
}

type Moderation_RenameUserParams

type Moderation_RenameUserParams struct {
	ID   pgtype.UUID
	Name string
}

type Moderation_SearchUserLoginHistoryParams

type Moderation_SearchUserLoginHistoryParams struct {
	UserIds       []pgtype.UUID
	Search        string
	DateFrom      pgtype.Timestamptz
	DateTo        pgtype.Timestamptz
	SessionStatus string
	PageOffset    int32
	PageLimit     int32
}

type Moderation_SearchUserLoginHistoryRow

type Moderation_SearchUserLoginHistoryRow struct {
	ID              int64
	UserID          pgtype.UUID
	UserName        string
	CreatedAt       pgtype.Timestamptz
	UserAgent       string
	IpAddress       string
	ExpiresAt       pgtype.Timestamptz
	IsTerminated    bool
	LocationCountry string
	LocationRegion  string
	LocationCity    string
}

type Moderation_SearchUsersParams

type Moderation_SearchUsersParams struct {
	Search       string
	SearchID     pgtype.UUID
	BannedStatus string
	Role         string
	PageOffset   int32
	PageLimit    int32
}

type Moderation_SearchUsersRow

type Moderation_SearchUsersRow struct {
	ID          pgtype.UUID
	Name        string
	JoinedAt    pgtype.Timestamptz
	Role        UserRole
	IsBanned    bool
	LastVisitAt pgtype.Timestamptz
	BannedAt    pgtype.Timestamptz
	BanReason   string
}

type Moderation_SetChapterVisibilityParams

type Moderation_SetChapterVisibilityParams struct {
	ID                int64
	IsPubliclyVisible bool
}

type Moderation_SetCommentRemovedParams

type Moderation_SetCommentRemovedParams struct {
	ID      int64
	Removed bool
}

type Moderation_SetUserBannedParams

type Moderation_SetUserBannedParams struct {
	ID       pgtype.UUID
	IsBanned bool
}

type NullAgeRating

type NullAgeRating struct {
	AgeRating AgeRating
	Valid     bool // Valid is true if AgeRating is not NULL
}

func (*NullAgeRating) Scan

func (ns *NullAgeRating) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAgeRating) Value

func (ns NullAgeRating) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullCensorMode

type NullCensorMode struct {
	CensorMode CensorMode
	Valid      bool // Valid is true if CensorMode is not NULL
}

func (*NullCensorMode) Scan

func (ns *NullCensorMode) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCensorMode) Value

func (ns NullCensorMode) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullOlAnalyticsBucketPeriodType

type NullOlAnalyticsBucketPeriodType struct {
	OlAnalyticsBucketPeriodType OlAnalyticsBucketPeriodType
	Valid                       bool // Valid is true if OlAnalyticsBucketPeriodType is not NULL
}

func (*NullOlAnalyticsBucketPeriodType) Scan

func (ns *NullOlAnalyticsBucketPeriodType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullOlAnalyticsBucketPeriodType) Value

Value implements the driver Valuer interface.

type NullReadingListStatus

type NullReadingListStatus struct {
	ReadingListStatus ReadingListStatus
	Valid             bool // Valid is true if ReadingListStatus is not NULL
}

func (*NullReadingListStatus) Scan

func (ns *NullReadingListStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullReadingListStatus) Value

func (ns NullReadingListStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTagType

type NullTagType struct {
	TagType TagType
	Valid   bool // Valid is true if TagType is not NULL
}

func (*NullTagType) Scan

func (ns *NullTagType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTagType) Value

func (ns NullTagType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTypeOf2fa

type NullTypeOf2fa struct {
	TypeOf2fa TypeOf2fa
	Valid     bool // Valid is true if TypeOf2fa is not NULL
}

func (*NullTypeOf2fa) Scan

func (ns *NullTypeOf2fa) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTypeOf2fa) Value

func (ns NullTypeOf2fa) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUserRole

type NullUserRole struct {
	UserRole UserRole
	Valid    bool // Valid is true if UserRole is not NULL
}

func (*NullUserRole) Scan

func (ns *NullUserRole) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUserRole) Value

func (ns NullUserRole) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OlAnalyticsBookPopularityBucket

type OlAnalyticsBookPopularityBucket struct {
	BookID      int64
	BucketType  OlAnalyticsBucketPeriodType
	BucketStart pgtype.Timestamptz
	Value       float64
	UpdatedAt   pgtype.Timestamptz
}

type OlAnalyticsBucket

type OlAnalyticsBucket struct {
	BookID       int64
	Metric       string
	BucketType   OlAnalyticsBucketPeriodType
	BucketStart  pgtype.Timestamptz
	SamplesCount int64
	ValueSum     float64
	UpdatedAt    pgtype.Timestamptz
}

type OlAnalyticsBucketPeriodType

type OlAnalyticsBucketPeriodType string
const (
	OlAnalyticsBucketPeriodTypeAll   OlAnalyticsBucketPeriodType = "all"
	OlAnalyticsBucketPeriodTypeYear  OlAnalyticsBucketPeriodType = "year"
	OlAnalyticsBucketPeriodTypeMonth OlAnalyticsBucketPeriodType = "month"
	OlAnalyticsBucketPeriodTypeWeek  OlAnalyticsBucketPeriodType = "week"
	OlAnalyticsBucketPeriodTypeDay   OlAnalyticsBucketPeriodType = "day"
)

func (*OlAnalyticsBucketPeriodType) Scan

func (e *OlAnalyticsBucketPeriodType) Scan(src interface{}) error

type OlAnalyticsInteractionEvent

type OlAnalyticsInteractionEvent struct {
	ID        int64
	UserKey   string
	BookID    int64
	EventType string
	Value     float64
	CreatedAt pgtype.Timestamptz
}

type OlAnalyticsWorkerState

type OlAnalyticsWorkerState struct {
	WorkerName string
	LastLaunch pgtype.Timestamptz
	LastCursor int64
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) Analytics_GetEvents

func (q *Queries) Analytics_GetEvents(ctx context.Context, arg Analytics_GetEventsParams) ([]OlAnalyticsInteractionEvent, error)

func (*Queries) Analytics_GetMetricValue

func (*Queries) Analytics_GetMetricValues

func (q *Queries) Analytics_GetMetricValues(ctx context.Context, arg Analytics_GetMetricValuesParams) ([]Analytics_GetMetricValuesRow, error)

func (*Queries) Analytics_GetWorkerState

func (q *Queries) Analytics_GetWorkerState(ctx context.Context, workerName string) (OlAnalyticsWorkerState, error)

func (*Queries) Analytics_InsertEvent

func (q *Queries) Analytics_InsertEvent(ctx context.Context, arg []Analytics_InsertEventParams) (int64, error)

func (*Queries) Analytics_RecalculateBookPopularity

func (q *Queries) Analytics_RecalculateBookPopularity(ctx context.Context, arg Analytics_RecalculateBookPopularityParams) error

func (*Queries) Analytics_SetWorkerState

func (q *Queries) Analytics_SetWorkerState(ctx context.Context, arg Analytics_SetWorkerStateParams) error

func (*Queries) Analytics_UpdateMetrics

func (q *Queries) Analytics_UpdateMetrics(ctx context.Context, arg Analytics_UpdateMetricsParams) error

func (*Queries) BookSetCover

func (q *Queries) BookSetCover(ctx context.Context, arg BookSetCoverParams) error

func (*Queries) Book_Book_ManagerGetUserBooksCount

func (q *Queries) Book_Book_ManagerGetUserBooksCount(ctx context.Context, arg Book_Book_ManagerGetUserBooksCountParams) (int64, error)

func (*Queries) Book_Get

func (q *Queries) Book_Get(ctx context.Context, id int64) (Book_GetRow, error)

func (*Queries) Book_GetByIds

func (q *Queries) Book_GetByIds(ctx context.Context, ids []int64) ([]Book_GetByIdsRow, error)

func (*Queries) Book_GetByUser

func (q *Queries) Book_GetByUser(ctx context.Context, arg Book_GetByUserParams) ([]Book, error)

func (*Queries) Book_GetChapterOrder

func (q *Queries) Book_GetChapterOrder(ctx context.Context, bookID int64) ([]Book_GetChapterOrderRow, error)

func (*Queries) Book_GetFirstChapterID

func (q *Queries) Book_GetFirstChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) Book_GetLastChapterOrder

func (q *Queries) Book_GetLastChapterOrder(ctx context.Context, bookID int64) (int32, error)

func (*Queries) Book_GetPubliclyVisibleChapters

func (q *Queries) Book_GetPubliclyVisibleChapters(ctx context.Context, bookID int64) ([]Book_GetPubliclyVisibleChaptersRow, error)

func (*Queries) Book_Insert

func (q *Queries) Book_Insert(ctx context.Context, arg Book_InsertParams) error

func (*Queries) Book_InsertChapter

func (q *Queries) Book_InsertChapter(ctx context.Context, arg Book_InsertChapterParams) error

func (*Queries) Book_ManagerGetUserBooks

func (q *Queries) Book_ManagerGetUserBooks(ctx context.Context, arg Book_ManagerGetUserBooksParams) ([]Book_ManagerGetUserBooksRow, error)

func (*Queries) Book_SetChapterOrder

func (q *Queries) Book_SetChapterOrder(ctx context.Context, arg Book_SetChapterOrderParams) error

func (*Queries) Book_Trash

func (q *Queries) Book_Trash(ctx context.Context, id int64) error

func (*Queries) Book_UnTrash

func (q *Queries) Book_UnTrash(ctx context.Context, arg Book_UnTrashParams) error

func (*Queries) Book_Update

func (q *Queries) Book_Update(ctx context.Context, arg Book_UpdateParams) error

func (*Queries) CLI_Util_MinifyContent_UpdateBookSummary

func (q *Queries) CLI_Util_MinifyContent_UpdateBookSummary(ctx context.Context, arg CLI_Util_MinifyContent_UpdateBookSummaryParams) error

func (*Queries) CLI_Util_MinifyContent_UpdateChapter

func (q *Queries) CLI_Util_MinifyContent_UpdateChapter(ctx context.Context, arg CLI_Util_MinifyContent_UpdateChapterParams) error

func (*Queries) Chapter_Update

func (q *Queries) Chapter_Update(ctx context.Context, arg Chapter_UpdateParams) (int64, error)

func (*Queries) Chapter_UpdateDetails

func (q *Queries) Chapter_UpdateDetails(ctx context.Context, arg Chapter_UpdateDetailsParams) (int64, error)

func (*Queries) Chapter_UserCanEdit

func (q *Queries) Chapter_UserCanEdit(ctx context.Context, arg Chapter_UserCanEditParams) (bool, error)

func (*Queries) Collection_AddBookToCollection

func (q *Queries) Collection_AddBookToCollection(ctx context.Context, arg Collection_AddBookToCollectionParams) error

func (*Queries) Collection_CountBooks

func (q *Queries) Collection_CountBooks(ctx context.Context, collectionID int64) (int64, error)

func (*Queries) Collection_CountByUser

func (q *Queries) Collection_CountByUser(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) Collection_Delete

func (q *Queries) Collection_Delete(ctx context.Context, id int64) error

func (*Queries) Collection_DeleteAllBooks

func (q *Queries) Collection_DeleteAllBooks(ctx context.Context, collectionID int64) error

func (*Queries) Collection_DeleteBookFromCollection

func (q *Queries) Collection_DeleteBookFromCollection(ctx context.Context, arg Collection_DeleteBookFromCollectionParams) error

func (*Queries) Collection_Get

func (q *Queries) Collection_Get(ctx context.Context, id int64) (Collection_GetRow, error)

func (*Queries) Collection_GetBooks

func (q *Queries) Collection_GetBooks(ctx context.Context, arg Collection_GetBooksParams) ([]Collection_GetBooksRow, error)

func (*Queries) Collection_GetByBook

func (q *Queries) Collection_GetByBook(ctx context.Context, arg Collection_GetByBookParams) ([]Collection_GetByBookRow, error)

func (*Queries) Collection_GetByUser

func (q *Queries) Collection_GetByUser(ctx context.Context, arg Collection_GetByUserParams) ([]Collection_GetByUserRow, error)

func (*Queries) Collection_GetMaxOrder

func (q *Queries) Collection_GetMaxOrder(ctx context.Context, collectionID int64) (int32, error)

func (*Queries) Collection_GetRecentByUser

func (q *Queries) Collection_GetRecentByUser(ctx context.Context, arg Collection_GetRecentByUserParams) ([]Collection, error)

func (*Queries) Collection_Insert

func (q *Queries) Collection_Insert(ctx context.Context, arg Collection_InsertParams) error

func (*Queries) Collection_RecalculateCounter

func (q *Queries) Collection_RecalculateCounter(ctx context.Context, collectionID int64) error

func (*Queries) Collection_Update

func (q *Queries) Collection_Update(ctx context.Context, arg Collection_UpdateParams) error

func (*Queries) Collections_ListByID

func (q *Queries) Collections_ListByID(ctx context.Context, dollar_1 []int64) ([]Collection, error)

func (*Queries) Comment_CountByChapter

func (q *Queries) Comment_CountByChapter(ctx context.Context, chapterID int64) (int64, error)

func (*Queries) Comment_GetByChapter

func (q *Queries) Comment_GetByChapter(ctx context.Context, arg Comment_GetByChapterParams) ([]Comment_GetByChapterRow, error)

func (*Queries) Comment_GetByChapterAfter

func (q *Queries) Comment_GetByChapterAfter(ctx context.Context, arg Comment_GetByChapterAfterParams) ([]Comment_GetByChapterAfterRow, error)

func (*Queries) Comment_GetByID

func (q *Queries) Comment_GetByID(ctx context.Context, id int64) (Comment, error)

func (*Queries) Comment_GetChildComments

func (q *Queries) Comment_GetChildComments(ctx context.Context, arg Comment_GetChildCommentsParams) ([]Comment_GetChildCommentsRow, error)

func (*Queries) Comment_GetLikedComments

func (q *Queries) Comment_GetLikedComments(ctx context.Context, arg Comment_GetLikedCommentsParams) ([]Comment_GetLikedCommentsRow, error)

func (*Queries) Comment_GetWithUserByID

func (q *Queries) Comment_GetWithUserByID(ctx context.Context, id int64) (Comment_GetWithUserByIDRow, error)

func (*Queries) Comment_Insert

func (q *Queries) Comment_Insert(ctx context.Context, arg Comment_InsertParams) error

func (*Queries) Comment_Like

func (q *Queries) Comment_Like(ctx context.Context, arg Comment_LikeParams) error

func (*Queries) Comment_RecalculateSubcomments

func (q *Queries) Comment_RecalculateSubcomments(ctx context.Context, id pgtype.Int8) error

func (*Queries) Comment_UnLike

func (q *Queries) Comment_UnLike(ctx context.Context, arg Comment_UnLikeParams) error

func (*Queries) Comment_Update

func (q *Queries) Comment_Update(ctx context.Context, arg Comment_UpdateParams) (pgconn.CommandTag, error)

func (*Queries) DefinedTagsAreInitialized

func (q *Queries) DefinedTagsAreInitialized(ctx context.Context) (bool, error)

func (*Queries) DeleteInactive2FADevices

func (q *Queries) DeleteInactive2FADevices(ctx context.Context, createdAt pgtype.Timestamptz) error

func (*Queries) DeleteRate

func (q *Queries) DeleteRate(ctx context.Context, arg DeleteRateParams) error

func (*Queries) DeleteReview

func (q *Queries) DeleteReview(ctx context.Context, arg DeleteReviewParams) error

func (*Queries) DeleteUserFollow

func (q *Queries) DeleteUserFollow(ctx context.Context, arg DeleteUserFollowParams) error

func (*Queries) Draft_ClearChapterSchedules

func (q *Queries) Draft_ClearChapterSchedules(ctx context.Context, chapterID int64) error

func (*Queries) Draft_Delete

func (q *Queries) Draft_Delete(ctx context.Context, id int64) error

func (*Queries) Draft_GetById

func (q *Queries) Draft_GetById(ctx context.Context, id int64) (Draft_GetByIdRow, error)

func (*Queries) Draft_GetLatestID

func (q *Queries) Draft_GetLatestID(ctx context.Context, chapterID int64) (int64, error)

func (*Queries) Draft_Insert

func (q *Queries) Draft_Insert(ctx context.Context, arg Draft_InsertParams) error

func (*Queries) Draft_MarkAsPublished

func (q *Queries) Draft_MarkAsPublished(ctx context.Context, id int64) error

func (*Queries) Draft_PublishDue

func (q *Queries) Draft_PublishDue(ctx context.Context) ([]int64, error)

func (*Queries) Draft_Schedule

func (q *Queries) Draft_Schedule(ctx context.Context, arg Draft_ScheduleParams) error

func (*Queries) Draft_Update

func (q *Queries) Draft_Update(ctx context.Context, arg Draft_UpdateParams) error

func (*Queries) Draft_UpdateChapterName

func (q *Queries) Draft_UpdateChapterName(ctx context.Context, arg Draft_UpdateChapterNameParams) error

func (*Queries) Draft_UpdateContent

func (q *Queries) Draft_UpdateContent(ctx context.Context, arg Draft_UpdateContentParams) error

func (*Queries) Draft_UserCanAccess

func (q *Queries) Draft_UserCanAccess(ctx context.Context, arg Draft_UserCanAccessParams) (bool, error)

func (*Queries) EmailVerification_Delete

func (q *Queries) EmailVerification_Delete(ctx context.Context, email string) error

func (*Queries) EmailVerification_Get

func (q *Queries) EmailVerification_Get(ctx context.Context, email string) (EmailVerification, error)

func (*Queries) EmailVerification_Insert

func (q *Queries) EmailVerification_Insert(ctx context.Context, arg EmailVerification_InsertParams) error

func (*Queries) GetAllBookChapters

func (q *Queries) GetAllBookChapters(ctx context.Context, bookID int64) ([]GetAllBookChaptersRow, error)

func (*Queries) GetAllBooks

func (q *Queries) GetAllBooks(ctx context.Context, arg GetAllBooksParams) ([]GetAllBooksRow, error)

func (*Queries) GetBookCollectionData

func (q *Queries) GetBookCollectionData(ctx context.Context, bookID int64) ([]GetBookCollectionDataRow, error)

func (*Queries) GetBookReadingListState

func (q *Queries) GetBookReadingListState(ctx context.Context, arg GetBookReadingListStateParams) (GetBookReadingListStateRow, error)

func (*Queries) GetBookReviews

func (q *Queries) GetBookReviews(ctx context.Context, arg GetBookReviewsParams) ([]GetBookReviewsRow, error)

func (*Queries) GetBookReviewsDistribution

func (q *Queries) GetBookReviewsDistribution(ctx context.Context, bookID int64) ([]GetBookReviewsDistributionRow, error)

func (*Queries) GetBookSearchRelatedData

func (q *Queries) GetBookSearchRelatedData(ctx context.Context, ids []int64) ([]GetBookSearchRelatedDataRow, error)

func (*Queries) GetBooksCollectionData

func (q *Queries) GetBooksCollectionData(ctx context.Context, dollar_1 []int64) ([]GetBooksCollectionDataRow, error)

func (*Queries) GetChapterBookID

func (q *Queries) GetChapterBookID(ctx context.Context, id int64) (int64, error)

func (*Queries) GetChaptersOrder

func (q *Queries) GetChaptersOrder(ctx context.Context, bookID int64) ([]int64, error)

func (*Queries) GetFirstChapterID

func (q *Queries) GetFirstChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) GetLastChapterID

func (q *Queries) GetLastChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) GetRandomPublicBookIDs

func (q *Queries) GetRandomPublicBookIDs(ctx context.Context, limit int32) ([]int64, error)

func (*Queries) GetRate

func (q *Queries) GetRate(ctx context.Context, arg GetRateParams) (int16, error)

func (*Queries) GetRating

func (q *Queries) GetRating(ctx context.Context, arg GetRatingParams) (Rating, error)

func (*Queries) GetReview

func (q *Queries) GetReview(ctx context.Context, arg GetReviewParams) (Review, error)

func (*Queries) GetReviewAndRating

func (q *Queries) GetReviewAndRating(ctx context.Context, arg GetReviewAndRatingParams) (GetReviewAndRatingRow, error)

func (*Queries) GetTag

func (q *Queries) GetTag(ctx context.Context, id int64) (GetTagRow, error)

func (*Queries) GetTagParent

func (q *Queries) GetTagParent(ctx context.Context, id int64) (DefinedTag, error)

func (*Queries) GetTagsByIds

func (q *Queries) GetTagsByIds(ctx context.Context, ids []int64) ([]DefinedTag, error)

func (*Queries) GetTagsByName

func (q *Queries) GetTagsByName(ctx context.Context, names []string) ([]DefinedTag, error)

func (*Queries) GetTopUserBooks

func (q *Queries) GetTopUserBooks(ctx context.Context, arg GetTopUserBooksParams) ([]Book, error)

func (*Queries) GetUserLibrary

func (q *Queries) GetUserLibrary(ctx context.Context, arg GetUserLibraryParams) ([]GetUserLibraryRow, error)

func (*Queries) GetUserPrivacySettings

func (q *Queries) GetUserPrivacySettings(ctx context.Context, id pgtype.UUID) (GetUserPrivacySettingsRow, error)

func (*Queries) ImportTags

func (q *Queries) ImportTags(ctx context.Context, dollar_1 []byte) error

func (*Queries) InsertDefinedTag

func (q *Queries) InsertDefinedTag(ctx context.Context, arg InsertDefinedTagParams) error

func (*Queries) InsertDefinedTagEnMasse

func (q *Queries) InsertDefinedTagEnMasse(ctx context.Context, arg []InsertDefinedTagEnMasseParams) (int64, error)

func (*Queries) InsertOrUpdateRate

func (q *Queries) InsertOrUpdateRate(ctx context.Context, arg InsertOrUpdateRateParams) error

func (*Queries) InsertOrUpdateReview

func (q *Queries) InsertOrUpdateReview(ctx context.Context, arg InsertOrUpdateReviewParams) (Review, error)

func (*Queries) ModAddBookLog

func (q *Queries) ModAddBookLog(ctx context.Context, arg ModAddBookLogParams) error

func (*Queries) ModChangeBookAgeRating

func (q *Queries) ModChangeBookAgeRating(ctx context.Context, arg ModChangeBookAgeRatingParams) error

func (*Queries) ModChangeBookSummary

func (q *Queries) ModChangeBookSummary(ctx context.Context, arg ModChangeBookSummaryParams) error

func (*Queries) ModCountBookLogFiltered

func (q *Queries) ModCountBookLogFiltered(ctx context.Context, arg ModCountBookLogFilteredParams) (int64, error)

func (*Queries) ModCountBooks

func (q *Queries) ModCountBooks(ctx context.Context, arg ModCountBooksParams) (int64, error)

func (*Queries) ModGetBookChapters

func (q *Queries) ModGetBookChapters(ctx context.Context, bookID int64) ([]ModGetBookChaptersRow, error)

func (*Queries) ModGetBookInfo

func (q *Queries) ModGetBookInfo(ctx context.Context, id int64) (ModGetBookInfoRow, error)

func (*Queries) ModGetBookLogFiltered

func (q *Queries) ModGetBookLogFiltered(ctx context.Context, arg ModGetBookLogFilteredParams) ([]ModGetBookLogFilteredRow, error)

func (*Queries) ModGetBookModState

func (q *Queries) ModGetBookModState(ctx context.Context, id int64) (ModGetBookModStateRow, error)

func (*Queries) ModPermRemoveBook

func (q *Queries) ModPermRemoveBook(ctx context.Context, arg ModPermRemoveBookParams) error

func (*Queries) ModSearchBooks

func (q *Queries) ModSearchBooks(ctx context.Context, arg ModSearchBooksParams) ([]ModSearchBooksRow, error)

func (*Queries) ModSetBookBanned

func (q *Queries) ModSetBookBanned(ctx context.Context, arg ModSetBookBannedParams) error

func (*Queries) ModSetBookShadowBanned

func (q *Queries) ModSetBookShadowBanned(ctx context.Context, arg ModSetBookShadowBannedParams) error

func (*Queries) Moderation_AddLog

func (q *Queries) Moderation_AddLog(ctx context.Context, arg Moderation_AddLogParams) error

func (*Queries) Moderation_AddUserBan

func (q *Queries) Moderation_AddUserBan(ctx context.Context, arg Moderation_AddUserBanParams) error

func (*Queries) Moderation_ChangeUserAbout

func (q *Queries) Moderation_ChangeUserAbout(ctx context.Context, arg Moderation_ChangeUserAboutParams) error

func (*Queries) Moderation_CountAuditLog

func (q *Queries) Moderation_CountAuditLog(ctx context.Context, targetType string) (int64, error)

func (*Queries) Moderation_CountUserHistory

func (q *Queries) Moderation_CountUserHistory(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) Moderation_CountUserLoginHistory

func (q *Queries) Moderation_CountUserLoginHistory(ctx context.Context, arg Moderation_CountUserLoginHistoryParams) (int64, error)

func (*Queries) Moderation_CountUserReports

func (q *Queries) Moderation_CountUserReports(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) Moderation_CountUsers

func (q *Queries) Moderation_CountUsers(ctx context.Context, arg Moderation_CountUsersParams) (int64, error)

func (*Queries) Moderation_GetAuditLog

func (q *Queries) Moderation_GetAuditLog(ctx context.Context, arg Moderation_GetAuditLogParams) ([]Moderation_GetAuditLogRow, error)

func (*Queries) Moderation_GetChapter

func (q *Queries) Moderation_GetChapter(ctx context.Context, id int64) (BookChapter, error)

func (*Queries) Moderation_GetLatestUserBanExpiry

func (q *Queries) Moderation_GetLatestUserBanExpiry(ctx context.Context, userID pgtype.UUID) (pgtype.Timestamptz, error)

func (*Queries) Moderation_GetRandomUserID

func (q *Queries) Moderation_GetRandomUserID(ctx context.Context) (pgtype.UUID, error)

func (*Queries) Moderation_GetRecentLoginSessions

func (q *Queries) Moderation_GetRecentLoginSessions(ctx context.Context, userID pgtype.UUID) ([]Moderation_GetRecentLoginSessionsRow, error)

func (*Queries) Moderation_GetUserBooks

func (q *Queries) Moderation_GetUserBooks(ctx context.Context, arg Moderation_GetUserBooksParams) ([]Moderation_GetUserBooksRow, error)

func (*Queries) Moderation_GetUserComments

func (q *Queries) Moderation_GetUserComments(ctx context.Context, arg Moderation_GetUserCommentsParams) ([]Moderation_GetUserCommentsRow, error)

func (*Queries) Moderation_GetUserHistory

func (q *Queries) Moderation_GetUserHistory(ctx context.Context, arg Moderation_GetUserHistoryParams) ([]Moderation_GetUserHistoryRow, error)

func (*Queries) Moderation_GetUserInfo

func (q *Queries) Moderation_GetUserInfo(ctx context.Context, id pgtype.UUID) (Moderation_GetUserInfoRow, error)

func (*Queries) Moderation_GetUserLoginHistory

func (q *Queries) Moderation_GetUserLoginHistory(ctx context.Context, userID pgtype.UUID) ([]Moderation_GetUserLoginHistoryRow, error)

func (*Queries) Moderation_GetUserReports

func (q *Queries) Moderation_GetUserReports(ctx context.Context, arg Moderation_GetUserReportsParams) ([]Moderation_GetUserReportsRow, error)

func (*Queries) Moderation_RenameUser

func (q *Queries) Moderation_RenameUser(ctx context.Context, arg Moderation_RenameUserParams) error

func (*Queries) Moderation_SearchUsers

func (q *Queries) Moderation_SearchUsers(ctx context.Context, arg Moderation_SearchUsersParams) ([]Moderation_SearchUsersRow, error)

func (*Queries) Moderation_SetChapterVisibility

func (q *Queries) Moderation_SetChapterVisibility(ctx context.Context, arg Moderation_SetChapterVisibilityParams) error

func (*Queries) Moderation_SetCommentRemoved

func (q *Queries) Moderation_SetCommentRemoved(ctx context.Context, arg Moderation_SetCommentRemovedParams) error

func (*Queries) Moderation_SetUserBanned

func (q *Queries) Moderation_SetUserBanned(ctx context.Context, arg Moderation_SetUserBannedParams) error

func (*Queries) ReaderPreferences_Get

func (q *Queries) ReaderPreferences_Get(ctx context.Context, userID pgtype.UUID) (UserReaderPreference, error)

func (*Queries) ReaderPreferences_Upsert

func (q *Queries) ReaderPreferences_Upsert(ctx context.Context, arg ReaderPreferences_UpsertParams) error

func (*Queries) RecalculateBookRating

func (q *Queries) RecalculateBookRating(ctx context.Context, bookID int64) error

func (*Queries) RecalculateBookStats

func (q *Queries) RecalculateBookStats(ctx context.Context, id int64) error

func (*Queries) RemoveUnusedDefaultTags

func (q *Queries) RemoveUnusedDefaultTags(ctx context.Context, names []string) error

func (*Queries) Report_BookChapterExists

func (q *Queries) Report_BookChapterExists(ctx context.Context, arg Report_BookChapterExistsParams) (bool, error)

func (*Queries) Report_BookExists

func (q *Queries) Report_BookExists(ctx context.Context, id int64) (bool, error)

func (*Queries) Report_CommentExists

func (q *Queries) Report_CommentExists(ctx context.Context, id int64) (bool, error)

func (*Queries) Report_CountSearch

func (q *Queries) Report_CountSearch(ctx context.Context, arg Report_CountSearchParams) (int64, error)

func (*Queries) Report_Create

func (q *Queries) Report_Create(ctx context.Context, arg Report_CreateParams) (Report_CreateRow, error)

func (*Queries) Report_GetBookContext

func (q *Queries) Report_GetBookContext(ctx context.Context, id int64) (Report_GetBookContextRow, error)

func (*Queries) Report_GetByID

func (q *Queries) Report_GetByID(ctx context.Context, id int64) (Report_GetByIDRow, error)

func (*Queries) Report_GetCommentContext

func (q *Queries) Report_GetCommentContext(ctx context.Context, id int64) (Report_GetCommentContextRow, error)

func (*Queries) Report_GetEvents

func (q *Queries) Report_GetEvents(ctx context.Context, reportID int64) ([]Report_GetEventsRow, error)

func (*Queries) Report_GetUserContext

func (q *Queries) Report_GetUserContext(ctx context.Context, id int64) (Report_GetUserContextRow, error)
func (q *Queries) Report_Search(ctx context.Context, arg Report_SearchParams) ([]Report_SearchRow, error)

func (*Queries) Report_SetStatus

func (q *Queries) Report_SetStatus(ctx context.Context, arg Report_SetStatusParams) (int64, error)

func (*Queries) Report_UserExists

func (q *Queries) Report_UserExists(ctx context.Context, id pgtype.UUID) (bool, error)

func (*Queries) SearchDefinedTags

func (q *Queries) SearchDefinedTags(ctx context.Context, arg SearchDefinedTagsParams) ([]DefinedTag, error)

func (*Queries) SearchDefinedTagsWithType

func (q *Queries) SearchDefinedTagsWithType(ctx context.Context, arg SearchDefinedTagsWithTypeParams) ([]DefinedTag, error)

func (*Queries) Session_GetInfo

func (q *Queries) Session_GetInfo(ctx context.Context, sid string) (Session_GetInfoRow, error)

func (*Queries) Session_GetUserSessions

func (q *Queries) Session_GetUserSessions(ctx context.Context, userID pgtype.UUID) ([]Session_GetUserSessionsRow, error)

func (*Queries) Session_Insert

func (q *Queries) Session_Insert(ctx context.Context, arg Session_InsertParams) error

func (*Queries) Session_Terminate

func (q *Queries) Session_Terminate(ctx context.Context, sid string) error

func (*Queries) Session_TerminateAllByUserID

func (q *Queries) Session_TerminateAllByUserID(ctx context.Context, userID pgtype.UUID) error

func (*Queries) SetBookReadingListChapter

func (q *Queries) SetBookReadingListChapter(ctx context.Context, arg SetBookReadingListChapterParams) error

func (*Queries) SetBookReadingListStatus

func (q *Queries) SetBookReadingListStatus(ctx context.Context, arg SetBookReadingListStatusParams) (ReadingList, error)

func (*Queries) SetBookReadingListStatusAndChapter

func (q *Queries) SetBookReadingListStatusAndChapter(ctx context.Context, arg SetBookReadingListStatusAndChapterParams) (ReadingList, error)

func (*Queries) SiteConfig_Get

func (q *Queries) SiteConfig_Get(ctx context.Context) ([]byte, error)

func (*Queries) SiteConfig_Set

func (q *Queries) SiteConfig_Set(ctx context.Context, value []byte) error

func (*Queries) UpdateTag

func (q *Queries) UpdateTag(ctx context.Context, arg UpdateTagParams) error

func (*Queries) UserData_Get

func (q *Queries) UserData_Get(ctx context.Context, arg UserData_GetParams) ([]byte, error)

func (*Queries) UserData_Set

func (q *Queries) UserData_Set(ctx context.Context, arg UserData_SetParams) error

func (*Queries) User_ExistsByEmail

func (q *Queries) User_ExistsByEmail(ctx context.Context, email string) (bool, error)

func (*Queries) User_ExistsByUsername

func (q *Queries) User_ExistsByUsername(ctx context.Context, name string) (bool, error)

func (*Queries) User_FindByLogin

func (q *Queries) User_FindByLogin(ctx context.Context, name string) (User, error)

func (*Queries) User_Get

func (q *Queries) User_Get(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) User_Get2FADevices

func (q *Queries) User_Get2FADevices(ctx context.Context, userID pgtype.UUID) ([]User2fa, error)

func (*Queries) User_GetAboutSettings

func (q *Queries) User_GetAboutSettings(ctx context.Context, id pgtype.UUID) (User_GetAboutSettingsRow, error)

func (*Queries) User_GetCustomizationSettings

func (q *Queries) User_GetCustomizationSettings(ctx context.Context, id pgtype.UUID) (User_GetCustomizationSettingsRow, error)

func (*Queries) User_GetDetails

func (q *Queries) User_GetDetails(ctx context.Context, arg User_GetDetailsParams) (User_GetDetailsRow, error)

func (*Queries) User_GetModerationSettings

func (q *Queries) User_GetModerationSettings(ctx context.Context, id pgtype.UUID) (User_GetModerationSettingsRow, error)

func (*Queries) User_GetNames

func (q *Queries) User_GetNames(ctx context.Context, ids []pgtype.UUID) ([]User_GetNamesRow, error)

func (*Queries) User_Insert

func (q *Queries) User_Insert(ctx context.Context, arg User_InsertParams) error

func (*Queries) User_InsertFollow

func (q *Queries) User_InsertFollow(ctx context.Context, arg User_InsertFollowParams) error

func (*Queries) User_IsFollowing

func (q *Queries) User_IsFollowing(ctx context.Context, arg User_IsFollowingParams) (bool, error)

func (*Queries) User_SetEmailVerified

func (q *Queries) User_SetEmailVerified(ctx context.Context, arg User_SetEmailVerifiedParams) error

func (*Queries) User_UpdateAboutSettings

func (q *Queries) User_UpdateAboutSettings(ctx context.Context, arg User_UpdateAboutSettingsParams) error

func (*Queries) User_UpdateCustomizationSettings

func (q *Queries) User_UpdateCustomizationSettings(ctx context.Context, arg User_UpdateCustomizationSettingsParams) error

func (*Queries) User_UpdateModerationSettings

func (q *Queries) User_UpdateModerationSettings(ctx context.Context, arg User_UpdateModerationSettingsParams) error

func (*Queries) User_UpdatePassword

func (q *Queries) User_UpdatePassword(ctx context.Context, arg User_UpdatePasswordParams) error

func (*Queries) User_UpdatePrivacySettings

func (q *Queries) User_UpdatePrivacySettings(ctx context.Context, arg User_UpdatePrivacySettingsParams) error

func (*Queries) User_UpdateRole

func (q *Queries) User_UpdateRole(ctx context.Context, arg User_UpdateRoleParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Rating

type Rating struct {
	UserID    pgtype.UUID
	BookID    int64
	Rating    int16
	UpdatedAt pgtype.Timestamptz
}

type ReaderPreferences_UpsertParams

type ReaderPreferences_UpsertParams struct {
	UserID     pgtype.UUID
	FontSize   int16
	FontFamily string
	PageColor  string
	Theme      string
}

type ReadingList

type ReadingList struct {
	UserID                pgtype.UUID
	BookID                int64
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
	LastUpdatedAt         pgtype.Timestamptz
}

type ReadingListHistory

type ReadingListHistory struct {
	UserID          pgtype.UUID
	BookID          int64
	ChapterID       int64
	FinishedReading bool
	Progress        int32
}

type ReadingListStatus

type ReadingListStatus string
const (
	ReadingListStatusDnf        ReadingListStatus = "dnf"
	ReadingListStatusReading    ReadingListStatus = "reading"
	ReadingListStatusPaused     ReadingListStatus = "paused"
	ReadingListStatusRead       ReadingListStatus = "read"
	ReadingListStatusWantToRead ReadingListStatus = "want_to_read"
)

func (*ReadingListStatus) Scan

func (e *ReadingListStatus) Scan(src interface{}) error

type Report

type Report struct {
	ID             int64
	Number         string
	Time           pgtype.Timestamptz
	ReporterUserID pgtype.UUID
	TargetType     string
	TargetID       string
	Reason         string
	Description    string
	BookChapterID  pgtype.Int8
	BookExcerpt    string
	Status         string
	Priority       string
}

type ReportNumberCounter

type ReportNumberCounter struct {
	Day     pgtype.Date
	Counter int64
}

type Report_BookChapterExistsParams

type Report_BookChapterExistsParams struct {
	ChapterID int64
	BookID    int64
}

type Report_CountSearchParams

type Report_CountSearchParams struct {
	Search     string
	TargetType string
}

type Report_CreateParams

type Report_CreateParams struct {
	Time           pgtype.Timestamptz
	ReporterUserID pgtype.UUID
	TargetType     string
	TargetID       string
	Reason         string
	Description    string
	BookChapterID  pgtype.Int8
	BookExcerpt    string
}

type Report_CreateRow

type Report_CreateRow struct {
	ID     int64
	Number string
}

type Report_GetBookContextRow

type Report_GetBookContextRow struct {
	BookChapterID           pgtype.Int8
	BookExcerpt             string
	BookID                  int64
	Title                   string
	Author                  string
	Cover                   string
	Chapter                 pgtype.Text
	AgeRating               AgeRating
	Warnings                []string
	IsPermRemoved           bool
	IsBanned                bool
	IsTrashed               bool
	IsPubliclyVisible       bool
	BookCreatedAt           pgtype.Timestamptz
	ChapterCreatedAt        pgtype.Timestamptz
	ChapterUpdatedAt        pgtype.Timestamptz
	ChapterContentUpdatedAt pgtype.Timestamptz
	RelatedReports          int32
}

type Report_GetByIDRow

type Report_GetByIDRow struct {
	ID               int64
	Number           string
	Time             pgtype.Timestamptz
	ReporterUserID   pgtype.UUID
	TargetType       string
	TargetID         string
	Reason           string
	Description      string
	BookChapterID    pgtype.Int8
	BookExcerpt      string
	Status           string
	Priority         string
	ReporterUserName string
}

type Report_GetCommentContextRow

type Report_GetCommentContextRow struct {
	ID             int64
	Content        string
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	AuthorID       pgtype.UUID
	AuthorName     string
	ChapterID      int64
	ChapterName    string
	BookID         int64
	BookName       string
	RelatedReports int32
}

type Report_GetEventsRow

type Report_GetEventsRow struct {
	ID            int64
	Time          pgtype.Timestamptz
	Type          string
	TargetType    string
	TargetID      string
	Payload       []byte
	ActorUserID   pgtype.UUID
	Reason        string
	ActorUserName string
}

type Report_GetUserContextRow

type Report_GetUserContextRow struct {
	ID             pgtype.UUID
	Name           string
	Email          string
	About          string
	JoinedAt       pgtype.Timestamptz
	Role           UserRole
	IsBanned       bool
	RelatedReports int32
}

type Report_SearchParams

type Report_SearchParams struct {
	Search     string
	TargetType string
	PageOffset int32
	PageLimit  int32
}

type Report_SearchRow

type Report_SearchRow struct {
	ID               int64
	Number           string
	Time             pgtype.Timestamptz
	ReporterUserID   pgtype.UUID
	TargetType       string
	TargetID         string
	Reason           string
	Description      string
	BookChapterID    pgtype.Int8
	BookExcerpt      string
	Status           string
	Priority         string
	ReporterUserName string
}

type Report_SetStatusParams

type Report_SetStatusParams struct {
	NewStatus string
	ReportID  int64
}

type Review

type Review struct {
	UserID        pgtype.UUID
	BookID        int64
	Content       string
	CreatedAt     pgtype.Timestamptz
	LastUpdatedAt pgtype.Timestamptz
	Likes         int32
}

type SearchDefinedTagsParams

type SearchDefinedTagsParams struct {
	LowercasedName string
	Limit          int32
}

type SearchDefinedTagsWithTypeParams

type SearchDefinedTagsWithTypeParams struct {
	LowercasedName string
	Limit          int32
	TagType        TagType
}

type Session

type Session struct {
	ID              int64
	Sid             string
	UserID          pgtype.UUID
	CreatedAt       pgtype.Timestamptz
	UserAgent       string
	IpAddress       string
	ExpiresAt       pgtype.Timestamptz
	IsTerminated    bool
	LocationCountry string
	LocationRegion  string
	LocationCity    string
}

type Session_GetInfoRow

type Session_GetInfoRow struct {
	ID              int64
	Sid             string
	UserID          pgtype.UUID
	CreatedAt       pgtype.Timestamptz
	UserAgent       string
	IpAddress       string
	ExpiresAt       pgtype.Timestamptz
	IsTerminated    bool
	LocationCountry string
	LocationRegion  string
	LocationCity    string
	UserName        string
	UserJoinedAt    pgtype.Timestamptz
	UserRole        UserRole
	UserIsBanned    bool
}

type Session_GetUserSessionsRow

type Session_GetUserSessionsRow struct {
	ID              int64
	Sid             string
	UserID          pgtype.UUID
	CreatedAt       pgtype.Timestamptz
	UserAgent       string
	IpAddress       string
	ExpiresAt       pgtype.Timestamptz
	IsTerminated    bool
	LocationCountry string
	LocationRegion  string
	LocationCity    string
	UserID_2        pgtype.UUID
	UserName        string
	UserJoinedAt    pgtype.Timestamptz
}

type Session_InsertParams

type Session_InsertParams struct {
	ID              int64
	Sid             string
	UserID          pgtype.UUID
	CreatedAt       pgtype.Timestamptz
	UserAgent       string
	IpAddress       string
	ExpiresAt       pgtype.Timestamptz
	LocationCountry string
	LocationRegion  string
	LocationCity    string
}

type SetBookReadingListChapterParams

type SetBookReadingListChapterParams struct {
	BookID                int64
	UserID                pgtype.UUID
	LastAccessedChapterID pgtype.Int8
}

type SetBookReadingListStatusAndChapterParams

type SetBookReadingListStatusAndChapterParams struct {
	BookID                int64
	UserID                pgtype.UUID
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
}

type SetBookReadingListStatusParams

type SetBookReadingListStatusParams struct {
	BookID int64
	UserID pgtype.UUID
	Status ReadingListStatus
}

type SiteConfig

type SiteConfig struct {
	Value []byte
	Key   string
}

type TagRow

type TagRow struct {
	ID          int64     `db:"id"`
	Name        string    `db:"name"`
	IsAdult     bool      `db:"is_adult"`
	IsSpoiler   bool      `db:"is_spoiler"`
	TagType     TagType   `db:"tag_type"`
	Description string    `db:"description"`
	IsDefault   bool      `db:"is_default"`
	CreatedAt   time.Time `db:"created_at"`

	SynonymOf     pgtype.Int8 `db:"synonym_of"`
	SynonymOfName pgtype.Text `db:"synonym_name"`
}

func ListTags

func ListTags(
	ctx context.Context,
	db DBTX,
	req ListTagsQuery,
) ([]TagRow, error)

type TagType

type TagType string
const (
	TagTypeFreeform TagType = "freeform"
	TagTypeWarning  TagType = "warning"
	TagTypeFandom   TagType = "fandom"
	TagTypeReltype  TagType = "reltype"
	TagTypeRel      TagType = "rel"
	TagTypeGenre    TagType = "genre"
)

func (*TagType) Scan

func (e *TagType) Scan(src interface{}) error

type TypeOf2fa

type TypeOf2fa string
const (
	TypeOf2faTotp     TypeOf2fa = "totp"
	TypeOf2faWebauthn TypeOf2fa = "webauthn"
)

func (*TypeOf2fa) Scan

func (e *TypeOf2fa) Scan(src interface{}) error

type UpdateTagParams

type UpdateTagParams struct {
	ID          int64
	Name        string
	Description string
	IsAdult     bool
	IsSpoiler   bool
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type User

type User struct {
	ID                    pgtype.UUID
	Name                  string
	Email                 string
	EmailVerified         bool
	JoinedAt              pgtype.Timestamptz
	PasswordHash          string
	Role                  UserRole
	IsBanned              bool
	AvatarFile            pgtype.Text
	About                 string
	Gender                string
	ProfileCss            string
	EnableProfileCss      bool
	DefaultTheme          string
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
	ShowAdultContent      bool
	CensoredTags          []string
	CensoredTagsMode      CensorMode
}

type User2fa

type User2fa struct {
	ID          pgtype.UUID
	UserID      pgtype.UUID
	Type        TypeOf2fa
	Key         string
	CreatedAt   pgtype.Timestamptz
	Initialized bool
	Active      bool
}

type UserBan

type UserBan struct {
	ID             int64
	UserID         pgtype.UUID
	CreatedAt      pgtype.Timestamptz
	BannedByUserID pgtype.UUID
	Note           string
	ExpiresAt      pgtype.Timestamptz
}

type UserData_GetParams

type UserData_GetParams struct {
	UserID pgtype.UUID
	Key    string
}

type UserData_SetParams

type UserData_SetParams struct {
	UserID pgtype.UUID
	Key    string
	Data   []byte
}

type UserDatum

type UserDatum struct {
	Key    string
	UserID pgtype.UUID
	Data   []byte
}

type UserFollower

type UserFollower struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
	CreatedAt  pgtype.Timestamptz
}

type UserReaderPreference

type UserReaderPreference struct {
	UserID     pgtype.UUID
	FontSize   int16
	FontFamily string
	PageColor  string
	Theme      string
	UpdatedAt  pgtype.Timestamptz
}

type UserRole

type UserRole string
const (
	UserRoleUser      UserRole = "user"
	UserRoleAdmin     UserRole = "admin"
	UserRoleModerator UserRole = "moderator"
	UserRoleSystem    UserRole = "system"
)

func (*UserRole) Scan

func (e *UserRole) Scan(src interface{}) error

type UserRow

type UserRow struct {
	ID       pgtype.UUID
	Name     string
	Role     UserRole
	IsBanned bool
	JoinedAt time.Time
}

func ListUsers

func ListUsers(ctx context.Context, db DBTX, req UsersQuery) ([]UserRow, error)

type User_GetAboutSettingsRow

type User_GetAboutSettingsRow struct {
	About  string
	Gender string
}

type User_GetCustomizationSettingsRow

type User_GetCustomizationSettingsRow struct {
	ProfileCss       string
	EnableProfileCss bool
	DefaultTheme     string
}

type User_GetDetailsParams

type User_GetDetailsParams struct {
	ID          pgtype.UUID
	ActorUserID pgtype.UUID
}

type User_GetDetailsRow

type User_GetDetailsRow struct {
	ID                    pgtype.UUID
	Name                  string
	Email                 string
	EmailVerified         bool
	JoinedAt              pgtype.Timestamptz
	PasswordHash          string
	Role                  UserRole
	IsBanned              bool
	AvatarFile            pgtype.Text
	About                 string
	Gender                string
	ProfileCss            string
	EnableProfileCss      bool
	DefaultTheme          string
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
	ShowAdultContent      bool
	CensoredTags          []string
	CensoredTagsMode      CensorMode
	BooksTotal            int64
	Followers             int64
	Following             int64
	IsFollowing           bool
}

type User_GetModerationSettingsRow

type User_GetModerationSettingsRow struct {
	ShowAdultContent bool
	CensoredTags     []string
	CensoredTagsMode CensorMode
}

type User_GetNamesRow

type User_GetNamesRow struct {
	Name string
	ID   pgtype.UUID
}

type User_InsertFollowParams

type User_InsertFollowParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type User_InsertParams

type User_InsertParams struct {
	ID            pgtype.UUID
	Name          string
	PasswordHash  string
	JoinedAt      pgtype.Timestamptz
	Email         string
	EmailVerified bool
}

type User_IsFollowingParams

type User_IsFollowingParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type User_SetEmailVerifiedParams

type User_SetEmailVerifiedParams struct {
	EmailVerified bool
	ID            pgtype.UUID
}

type User_UpdateAboutSettingsParams

type User_UpdateAboutSettingsParams struct {
	ID     pgtype.UUID
	About  string
	Gender string
}

type User_UpdateCustomizationSettingsParams

type User_UpdateCustomizationSettingsParams struct {
	ID               pgtype.UUID
	ProfileCss       string
	EnableProfileCss bool
	DefaultTheme     string
}

type User_UpdateModerationSettingsParams

type User_UpdateModerationSettingsParams struct {
	ID               pgtype.UUID
	ShowAdultContent bool
	CensoredTags     []string
	CensoredTagsMode CensorMode
}

type User_UpdatePasswordParams

type User_UpdatePasswordParams struct {
	ID           pgtype.UUID
	PasswordHash string
}

type User_UpdatePrivacySettingsParams

type User_UpdatePrivacySettingsParams struct {
	ID                    pgtype.UUID
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
}

type User_UpdateRoleParams

type User_UpdateRoleParams struct {
	ID   pgtype.UUID
	Role UserRole
}

type UsersQuery

type UsersQuery struct {
	Query  string
	Roles  []UserRole
	Banned bool

	Limit  uint
	Offset uint
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL