You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dao_vcs_project_repository_analyze.go
    path of file: ./repos/cds/engine/api/repository
    
    the code of the file until where you have to start completion: package repository

import (
	"context"
	"github.com/ovh/cds/sdk/telemetry"
	"time"

	"github.com/go-gorp/gorp"
	"gi
    
func DeleteOldestAnalysis(ctx context.Context, db gorpmapper.SqlExecutorWithTx, projectRepositoryID string) error {
	query := gorpmapping.NewQuery("SELECT * from project_repository_analysis WHERE project_repository_id = $1 ORDER BY created asc LIMIT 1").Args(projectRepositoryID)
	analysis, err := getAnalysis(ctx, db, query)
	if err != nil {
		return err
	}

	dbData := dbProjectRepositoryAnalysis{ProjectRepositoryAnalysis: *analysis}
	if err := gorpmapping.Delete(db, &dbData); err != nil {
		return err
	}
	return nil
}