Add Blog Posts CRUD with SQLite
- Add modernc.org/sqlite (pure Go, no CGO) - Create models package with Post struct - Implement SQLite connection and schema auto-creation - Add CRUD methods to database package - Create post handlers with JSON API - Register API routes: GET/POST/PUT/DELETE /api/v1/posts - Set default DBURL to file:./data.db with WAL mode
This commit is contained in:
@@ -59,7 +59,7 @@ func New(lc fx.Lifecycle, params ConfigParams) (*Config, error) {
|
||||
viper.SetDefault("DEV_ADMIN_USERNAME", "")
|
||||
viper.SetDefault("DEV_ADMIN_PASSWORD", "")
|
||||
viper.SetDefault("PORT", "8080")
|
||||
viper.SetDefault("DBURL", "")
|
||||
viper.SetDefault("DBURL", "file:./data.db?_journal_mode=WAL")
|
||||
viper.SetDefault("SENTRY_DSN", "")
|
||||
viper.SetDefault("METRICS_USERNAME", "")
|
||||
viper.SetDefault("METRICS_PASSWORD", "")
|
||||
|
||||
Reference in New Issue
Block a user