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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user