postgres

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID               int64
	Title            string
	BookID           string
	Owner            sql.NullString
	BookPath         string
	StoreUrl         string
	Type             string
	ChildBooksNum    sql.NullInt64
	ChildBooksID     sql.NullString
	Depth            sql.NullInt64
	ParentFolder     sql.NullString
	PageCount        sql.NullInt64
	LastReadPage     sql.NullInt64
	FileSize         sql.NullInt64
	Author           sql.NullString
	Isbn             sql.NullString
	Press            sql.NullString
	PublishedAt      sql.NullString
	ExtractPath      sql.NullString
	ModifiedTime     sql.NullTime
	ExtractNum       sql.NullInt64
	BookComplete     sql.NullBool
	InitComplete     sql.NullBool
	NonUtf8zip       sql.NullBool
	ZipTextEncoding  sql.NullString
	CreatedByVersion sql.NullString
	IsRemote         sql.NullBool
	RemoteUrl        sql.NullString
	Deleted          sql.NullBool
}

type Bookmark

type Bookmark struct {
	ID          int64
	Type        string
	BookID      string
	BookStoreID sql.NullString
	PageIndex   int64
	Description sql.NullString
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
}

type CreateBookParams

type CreateBookParams struct {
	Title            string
	BookID           string
	Owner            sql.NullString
	BookPath         string
	StoreUrl         string
	Type             string
	ChildBooksNum    sql.NullInt64
	ChildBooksID     sql.NullString
	Depth            sql.NullInt64
	ParentFolder     sql.NullString
	PageCount        sql.NullInt64
	LastReadPage     sql.NullInt64
	FileSize         sql.NullInt64
	Author           sql.NullString
	Isbn             sql.NullString
	Press            sql.NullString
	PublishedAt      sql.NullString
	ExtractPath      sql.NullString
	ExtractNum       sql.NullInt64
	BookComplete     sql.NullBool
	InitComplete     sql.NullBool
	NonUtf8zip       sql.NullBool
	ZipTextEncoding  sql.NullString
	CreatedByVersion sql.NullString
	IsRemote         sql.NullBool
	RemoteUrl        sql.NullString
}

type CreateBookmarkParams

type CreateBookmarkParams struct {
	Type        string
	BookID      string
	BookStoreID sql.NullString
	PageIndex   int64
	Description sql.NullString
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
}

type CreatePageInfoParams

type CreatePageInfoParams struct {
	BookID     string
	Name       string
	Path       sql.NullString
	Size       sql.NullInt64
	ModTime    sql.NullTime
	Url        sql.NullString
	PageNum    sql.NullInt64
	Blurhash   sql.NullString
	Height     sql.NullInt64
	Width      sql.NullInt64
	ImgType    sql.NullString
	InsertHtml sql.NullString
}

type CreateUserParams

type CreateUserParams struct {
	Username  string
	Password  string
	Role      sql.NullString
	Email     sql.NullString
	Key       sql.NullString
	ExpiresAt sql.NullTime
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteBookmarkByBookIDAndTypeParams

type DeleteBookmarkByBookIDAndTypeParams struct {
	BookID string
	Type   string
}

type GetPageInfoByBookIDAndPageParams

type GetPageInfoByBookIDAndPageParams struct {
	BookID  string
	PageNum sql.NullInt64
}

type PageInfo

type PageInfo struct {
	ID         int64
	BookID     string
	Name       string
	Path       sql.NullString
	Size       sql.NullInt64
	ModTime    sql.NullTime
	Url        sql.NullString
	PageNum    sql.NullInt64
	Blurhash   sql.NullString
	Height     sql.NullInt64
	Width      sql.NullInt64
	ImgType    sql.NullString
	InsertHtml sql.NullString
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountBooks

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

Statistics queries Count total books

func (*Queries) CountBooksByType

func (q *Queries) CountBooksByType(ctx context.Context, type_ string) (int64, error)

Count books by type

func (*Queries) CountPageInfosByBookID

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

Count media files for a book

func (*Queries) CountUsers

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

Count total users

func (*Queries) CountUsersByRole

func (q *Queries) CountUsersByRole(ctx context.Context, role sql.NullString) (int64, error)

Count users by role

func (*Queries) CreateBook

func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (Book, error)

Create new book

func (*Queries) CreateBookmark

func (q *Queries) CreateBookmark(ctx context.Context, arg CreateBookmarkParams) (Bookmark, error)

Create a bookmark

func (*Queries) CreatePageInfo

func (q *Queries) CreatePageInfo(ctx context.Context, arg CreatePageInfoParams) (PageInfo, error)

Create media file record

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

Create new user

func (*Queries) DeleteBook

func (q *Queries) DeleteBook(ctx context.Context, bookID string) error

Delete book

func (*Queries) DeleteBookmarkByBookIDAndType

func (q *Queries) DeleteBookmarkByBookIDAndType(ctx context.Context, arg DeleteBookmarkByBookIDAndTypeParams) error

Delete a bookmark by (book_id, type)

func (*Queries) DeleteBookmarksByBookID

func (q *Queries) DeleteBookmarksByBookID(ctx context.Context, bookID string) error

Delete all bookmarks for a book

func (*Queries) DeletePageInfosByBookID

func (q *Queries) DeletePageInfosByBookID(ctx context.Context, bookID string) error

Delete all media files for a book

func (*Queries) DeleteUser

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

Delete user

func (*Queries) GetBookByBookPath

func (q *Queries) GetBookByBookPath(ctx context.Context, bookPath string) (Book, error)

Get book by file path

func (*Queries) GetBookByID

func (q *Queries) GetBookByID(ctx context.Context, bookID string) (Book, error)

Book related queries Get single book by ID

func (*Queries) GetPageInfoByBookIDAndPage

func (q *Queries) GetPageInfoByBookIDAndPage(ctx context.Context, arg GetPageInfoByBookIDAndPageParams) (PageInfo, error)

Get specific page by book ID and page number

func (*Queries) GetPageInfosByBookID

func (q *Queries) GetPageInfosByBookID(ctx context.Context, bookID string) ([]PageInfo, error)

Media files related queries Get all page information by book ID

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email sql.NullString) (User, error)

Get user by email

func (*Queries) GetUserByID

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

User related queries Get user by ID

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

Get user by username

func (*Queries) ListAllBookStoreURLs

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

get all store_url for books

func (*Queries) ListBookmarksByBookID

func (q *Queries) ListBookmarksByBookID(ctx context.Context, bookID string) ([]Bookmark, error)

Bookmarks related queries List bookmarks by book ID

func (*Queries) ListBooks

func (q *Queries) ListBooks(ctx context.Context) ([]Book, error)

List all books

func (*Queries) ListBooksByStorePath

func (q *Queries) ListBooksByStorePath(ctx context.Context, storeUrl string) ([]Book, error)

List books by store path

func (*Queries) ListBooksByType

func (q *Queries) ListBooksByType(ctx context.Context, type_ string) ([]Book, error)

List books by type

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

List all users

func (*Queries) MarkBookAsDeleted

func (q *Queries) MarkBookAsDeleted(ctx context.Context, bookID string) error

Mark book as deleted (soft delete)

func (*Queries) SearchBooksByTitle

func (q *Queries) SearchBooksByTitle(ctx context.Context, dollar_1 sql.NullString) ([]Book, error)

Search books by title (fuzzy search)

func (*Queries) UpdateBook

func (q *Queries) UpdateBook(ctx context.Context, arg UpdateBookParams) error

Update book information

func (*Queries) UpdateBookmark

func (q *Queries) UpdateBookmark(ctx context.Context, arg UpdateBookmarkParams) error

Update a bookmark (by book_id, type)

func (*Queries) UpdateLastReadPage

func (q *Queries) UpdateLastReadPage(ctx context.Context, arg UpdateLastReadPageParams) error

Update reading progress

func (*Queries) UpdatePageInfo

func (q *Queries) UpdatePageInfo(ctx context.Context, arg UpdatePageInfoParams) error

Update media file information

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

Update user information

func (*Queries) UpdateUserKey

func (q *Queries) UpdateUserKey(ctx context.Context, arg UpdateUserKeyParams) error

Update user key and expiration

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error

Update user password

func (*Queries) WithTx

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

type UpdateBookParams

type UpdateBookParams struct {
	Title            string
	Owner            sql.NullString
	BookPath         string
	StoreUrl         string
	Type             string
	ChildBooksNum    sql.NullInt64
	ChildBooksID     sql.NullString
	Depth            sql.NullInt64
	ParentFolder     sql.NullString
	PageCount        sql.NullInt64
	LastReadPage     sql.NullInt64
	FileSize         sql.NullInt64
	Author           sql.NullString
	Isbn             sql.NullString
	Press            sql.NullString
	PublishedAt      sql.NullString
	ExtractPath      sql.NullString
	ExtractNum       sql.NullInt64
	BookComplete     sql.NullBool
	InitComplete     sql.NullBool
	NonUtf8zip       sql.NullBool
	ZipTextEncoding  sql.NullString
	CreatedByVersion sql.NullString
	IsRemote         sql.NullBool
	RemoteUrl        sql.NullString
	BookID           string
}

type UpdateBookmarkParams

type UpdateBookmarkParams struct {
	Description sql.NullString
	PageIndex   int64
	BookID      string
	Type        string
}

type UpdateLastReadPageParams

type UpdateLastReadPageParams struct {
	PageIndex int64
	Type      string
	BookID    string
}

type UpdatePageInfoParams

type UpdatePageInfoParams struct {
	Name       string
	Path       sql.NullString
	Size       sql.NullInt64
	ModTime    sql.NullTime
	Url        sql.NullString
	Blurhash   sql.NullString
	Height     sql.NullInt64
	Width      sql.NullInt64
	ImgType    sql.NullString
	InsertHtml sql.NullString
	BookID     string
	PageNum    sql.NullInt64
}

type UpdateUserKeyParams

type UpdateUserKeyParams struct {
	Key       sql.NullString
	ExpiresAt sql.NullTime
	ID        int64
}

type UpdateUserParams

type UpdateUserParams struct {
	Username  string
	Password  string
	Role      sql.NullString
	Email     sql.NullString
	Key       sql.NullString
	ExpiresAt sql.NullTime
	ID        int64
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	Password string
	ID       int64
}

type User

type User struct {
	ID        int64
	Username  string
	Password  string
	Role      sql.NullString
	Email     sql.NullString
	Key       sql.NullString
	ExpiresAt sql.NullTime
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
}

Jump to

Keyboard shortcuts

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