mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-14 19:03:39 +00:00
add error return to database module
This commit is contained in:
@@ -79,6 +79,9 @@ func (t *DbSqlite) Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *DbSqlite) Database() *sql.DB {
|
||||
return t.db
|
||||
func (t *DbSqlite) Database() (*sql.DB, error) {
|
||||
if t.db == nil {
|
||||
return nil, fmt.Errorf("database not initialized")
|
||||
}
|
||||
return t.db, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user