feat: Phase 2 — database layer

- PostgreSQL schema: sources, manga, chapters, pages, source_meta with indexes
- golang-migrate runner with embedded SQL via go:embed (pgx5:// scheme)
- sqlc-generated type-safe queries for all tables (pgx/v5 native)
- Config package with all env vars including TTL durations
- Wire DB init and config into cmd/server/main.go
This commit is contained in:
achmad
2026-05-10 21:32:40 +07:00
parent 85d2ea6143
commit 95cab106d8
20 changed files with 1291 additions and 139 deletions
+13
View File
@@ -0,0 +1,13 @@
version: "2"
sql:
- engine: "postgresql"
schema: "internal/db/migrations/"
queries: "internal/db/queries/"
gen:
go:
package: "queries"
out: "internal/db/queries"
sql_package: "pgx/v5"
emit_json_tags: true
emit_db_tags: true
emit_pointers_for_null_types: true