feat: add database models and queries for annotations

- Add MediaNotes and MediaHighlights model structs with pgx v5 types
- Add EbookNotes and EbookHighlights for backward compatibility
- Add complete CRUD SQL queries for notes and highlights
- Add database connection pool function using pgx v5
- Generate sqlc code for new annotation functionality
This commit is contained in:
2026-01-28 15:42:34 -05:00
parent 168c6b2302
commit 29669e2fa3
4 changed files with 735 additions and 1 deletions
+6
View File
@@ -9,6 +9,7 @@ import (
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgconn"
"github.com/jackc/pgx/v5/pgxpool"
)
type DBTX interface {
@@ -30,3 +31,8 @@ func (q *Queries) WithTx(tx pgx.Tx) *Queries {
db: tx,
}
}
// NewConnection creates a new database connection pool
func NewConnection(databaseURL string) (*pgxpool.Pool, error) {
return pgxpool.New(context.Background(), databaseURL)
}