Implement opal-task Phase 1: Database foundation

- Add SQLite database with schema for tasks, tags, and working_set
- Implement config management with Viper (opal.yml)
- Create Task struct with proper types (*time.Time, Priority int)
- Add database migration system
- Implement recurrence pattern parsing (1d, 1w, 1m, 1y)
- Setup project structure with cmd/ and internal/engine/
- Add dependencies: sqlite3, uuid, cobra, viper, color
This commit is contained in:
2026-01-04 14:41:16 +01:00
parent 1d87d93172
commit 9b5261b34c
14 changed files with 579 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"fmt"
"os"
"git.jnss.me/joakim/opal/internal/engine"
)
func main() {
// Initialize database
if err := engine.InitDB(); err != nil {
fmt.Fprintf(os.Stderr, "Error initializing database: %v\n", err)
os.Exit(1)
}
defer engine.CloseDB()
// Load config
if _, err := engine.LoadConfig(); err != nil {
fmt.Fprintf(os.Stderr, "Error loading config: %v\n", err)
os.Exit(1)
}
fmt.Println("Opal task manager initialized successfully!")
fmt.Println("Database and configuration ready.")
}