internal/storage/postgres/storage.go
func (s *Storage) Delete(ctx context.Context, subjectID, accessToken, refreshToken string, expiredAtFrom, expiredAtTo *time.Time) (int64, error) {
	span, ctx := opentracing.StartSpanFromContext(ctx, "postgres.storage.delete")
	defer span.Finish()

	where, args := s.where(subjectID, accessToken, refreshToken, expiredAtFrom, expiredAtTo)
	if where.Len() == 0 {
		return 0, fmt.Errorf("session cannot be deleted, no where parameter provided: %s", where.String())
	}
	query := "DELETE FROM " + s.schema + "." + s.table + " WHERE " + where.String()
	labels := prometheus.Labels{"query": "delete"}
	start := time.Now()

	result, err := s.db.Exec(query, args...)
	s.incQueries(labels, start)
	if err != nil {
		s.incError(labels)
		return 0, err
	}

	return result.RowsAffected()
}
func (s *Storage) Delete(ctx context.Context, subjectID, accessToken, refreshToken string, expiredAtFrom, expiredAtTo *time.Time) (int64, error) {
	span, ctx := opentracing.StartSpanFromContext(ctx, "postgres.storage.delete")
	defer span.Finish()

	where, args := s.where(subjectID, accessToken, refreshToken, expiredAtFrom, expiredAtTo)
	if where.Len() == 0 {
		return 0, fmt.Errorf("session cannot be deleted, no where parameter provided: %s", where.String())
	}
	query := "DELETE FROM " + s.schema + "." + s.table + " WHERE " + where.String()
	labels := prometheus.Labels{"query": "delete"}
	start := time.Now()

	result, err := s.db.Exec(query, args...)
	s.incQueries(labels, start)
	if err != nil {
		s.incError(labels)
		return 0, err
	}

	return result.RowsAffected()
}
// Delete implements storage interface.