Commit WIP.

Laptop charger isn't charging?
This commit is contained in:
Benjamin A. Shelton 2026-10-07 18:57:26 -06:00
commit eeec866a31
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
5 changed files with 35 additions and 3 deletions

17
internal/app/migration.go Normal file
View file

@ -0,0 +1,17 @@
package app
import (
"code.destrealm.net/zancarius/justusbot/internal/settings"
"go.destrealm.net/migratory"
)
func DoMigration(conf *settings.Settings) error {
mg, err := migratory.New(conf.System.DSN)
if err != nil {
return err
}
_ = mg
return nil
}

View file

@ -9,6 +9,11 @@ import (
func connect(conf *settings.Settings) error {
db, err := sql.Open("sqlite3", conf.System.DSN)
if err != nil {
return nil
}
_ = db
return nil
}

View file

@ -15,7 +15,7 @@ import (
type Settings struct {
file string `toml:"-"`
fs vfs.VFS `toml:"-"`
FS vfs.VFS `toml:"-"`
API *API `toml:"api"`
DailyScripture *DailyScripture `toml:"daily_scripture"`
Translations *Translations `toml:"translations"`
@ -26,7 +26,7 @@ type Settings struct {
// Reload previously loaded configuration.
func (s *Settings) Reload() error {
st, err := LoadSettings(s.file, s.fs)
st, err := LoadSettings(s.file, s.FS)
if err != nil {
return err
}
@ -46,7 +46,7 @@ func (s *Settings) Save() error {
if err != nil {
return err
}
fp, err := s.fs.Mutable().OpenFile(s.file, os.O_TRUNC|os.O_CREATE, 0644)
fp, err := s.FS.Mutable().OpenFile(s.file, os.O_TRUNC|os.O_CREATE, 0644)
if err != nil {
return err
}
@ -70,6 +70,7 @@ type DailyScripture struct {
type System struct {
TimeZone string `toml:"timezone"`
DSN string `toml:"dsn"`
}
type Service struct {