Skip storing user stats when running with sqlite, since the queries aren't compatible with sqlite

This commit is contained in:
David Dworken 2023-09-26 20:49:21 -07:00
parent f84c2d86b5
commit d0712f84c6
No known key found for this signature in database

View File

@ -288,6 +288,11 @@ type ActiveUserStats struct {
}
func (db *DB) GenerateAndStoreActiveUserStats(ctx context.Context) error {
if db.DB.Name() == "sqlite" {
// Not supported on sqlite
return nil
}
totalNumDevices, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT COUNT(DISTINCT devices.device_id) FROM devices").Row())
if err != nil {
return err