feat(reader): add PDF annotations, Range streaming, and optimized chunk loading (#2701)

This commit is contained in:
ACX
2026-02-11 16:51:59 -07:00
committed by GitHub
parent 16de2d006f
commit 9ed6a3fe72
31 changed files with 450 additions and 749 deletions
@@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS pdf_annotations
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
book_id BIGINT NOT NULL,
data LONGTEXT NOT NULL,
version BIGINT NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
UNIQUE (user_id, book_id)
);
CREATE INDEX IF NOT EXISTS idx_pdf_annotations_user_id ON pdf_annotations (user_id);
CREATE INDEX IF NOT EXISTS idx_pdf_annotations_book_id ON pdf_annotations (book_id);
ALTER TABLE pdf_annotations
ADD CONSTRAINT fk_pdf_annotations_user
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE;
ALTER TABLE pdf_annotations
ADD CONSTRAINT fk_pdf_annotations_book
FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE;