summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder (aider) <wohilas@gmail.com>2025-04-05 14:17:23 +0300
committerGrail Finder (aider) <wohilas@gmail.com>2025-04-05 14:17:23 +0300
commit57681c509de8cf56db4f34902a1fed3380903eb1 (patch)
tree15056e3c3e8d057479ebdf2c83ff21d63ea8e4ff
parentabefce79dceba4dcf37bc1d8aa4fe9340622924a (diff)
refactor: replace direct table check with VerifyDB method
-rw-r--r--internal/database/sql/main.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/database/sql/main.go b/internal/database/sql/main.go
index 431dead..2d220dc 100644
--- a/internal/database/sql/main.go
+++ b/internal/database/sql/main.go
@@ -69,10 +69,7 @@ func Init(dbPath string) (*DB, error) {
return nil, err
}
- // Verify tables exist
- var tableCheck int
- err = result.Conn.Get(&tableCheck, `SELECT 1 FROM sqlite_master WHERE type='table' AND name='questions' LIMIT 1`)
- if err != nil {
+ if err := result.VerifyDB(); err != nil {
return nil, errors.Wrap(err, "database schema verification failed")
}