diff options
author | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 14:17:23 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 14:17:23 +0300 |
commit | 57681c509de8cf56db4f34902a1fed3380903eb1 (patch) | |
tree | 15056e3c3e8d057479ebdf2c83ff21d63ea8e4ff | |
parent | abefce79dceba4dcf37bc1d8aa4fe9340622924a (diff) |
refactor: replace direct table check with VerifyDB method
-rw-r--r-- | internal/database/sql/main.go | 5 |
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") } |