feat: add PostgreSQL persistence layer with Neon DB support

This commit is contained in:
user
2026-04-27 12:35:03 +09:00
parent 01d102f5ef
commit bfdc7399eb
12 changed files with 671 additions and 6 deletions

20
internal/db/migrate.go Normal file
View File

@@ -0,0 +1,20 @@
package db
import (
"context"
_ "embed"
"fmt"
"github.com/jackc/pgx/v5/pgxpool"
)
//go:embed migrations/001_init.sql
var initSQL string
func Migrate(pool *pgxpool.Pool) error {
_, err := pool.Exec(context.Background(), initSQL)
if err != nil {
return fmt.Errorf("run migration: %w", err)
}
return nil
}