Rip apart several new packages for inter-dependence

This will help make it clear what depends on what for rendering html
pages
This commit is contained in:
Eli Ribble 2026-01-07 16:07:51 +00:00
parent 4c23eba5d7
commit 572b8a9de9
11 changed files with 277 additions and 263 deletions

View file

@ -76,6 +76,7 @@ func doMigrations(connection_string string) error {
}
func InitializeDatabase(ctx context.Context, uri string) error {
log.Info().Str("dsn", uri).Msg("Connecting to database")
needs, err := needsMigrations(uri)
if err != nil {
return fmt.Errorf("Failed to determine if migrations are needed: %w", err)
@ -119,7 +120,6 @@ func InitializeDatabase(ctx context.Context, uri string) error {
}
func needsMigrations(connection_string string) (*bool, error) {
log.Info().Str("dsn", connection_string).Msg("Connecting to database")
db, err := sql.Open("pgx", connection_string)
if err != nil {
return nil, fmt.Errorf("Failed to open database connection: %w", err)