Skip to content

Commit

Permalink
Merge pull request #257 from SiaFoundation/nate/log-sqlite-version
Browse files Browse the repository at this point in the history
Log sqlite version when debug logging is enabled
  • Loading branch information
n8maninger authored Dec 30, 2023
2 parents 7be056e + a963611 commit 08d0fa6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions persist/sqlite/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"time"

"github.com/mattn/go-sqlite3"
"go.uber.org/zap"
"lukechampine.com/frand"
)
Expand Down Expand Up @@ -211,5 +212,7 @@ func OpenDatabase(fp string, log *zap.Logger) (*Store, error) {
// overwrite.
return nil, fmt.Errorf("failed to clear locked sectors table: %w", err)
}
sqliteVersion, _, _ := sqlite3.Version()
log.Debug("database initialized", zap.String("sqliteVersion", sqliteVersion), zap.Int("schemaVersion", len(migrations)+1), zap.String("path", fp))
return store, nil
}

0 comments on commit 08d0fa6

Please sign in to comment.