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: blob_migrate.go
    path of file: ./repos/stash/pkg/sqlite
    
    the code of the file until where you have to start completion: package sqlite

import (
	"context"
	"fmt"

	"github.com/jmoiron/sqlx"
)

func (qb *BlobStore) FindBlobs(ctx context.Context, n uint, lastChecksum string) ([]string, error) {
	table := qb.table()
	q := dialect.From(table).Select(table.Col(blobChecksumColumn)).Order(table.Col(blobChecksumColumn).Asc()).Limit(n)

	if lastChecksum != "" {
		q = q.Where(table.Col(blobChecksumColumn).Gt(lastChecksum))
	}

	const single = false
	var checksums []string
	if err := queryFunc(ctx, q, single, func(rows *sqlx.Rows) error {
		var checksum string
		if err := rows.Scan(&checksum); err != nil {
			return err
		}
		checksums = append(checksums, checksum)
		return nil
	}); err != nil 
    
func (qb *BlobStore) migrateBlobDatabase(ctx context.Context, checksum string, deleteOld bool) error {
	// ignore if the blob is already present in the database
	// (still delete the old data if requested)
	existing, err := qb.readFromDatabase(ctx, checksum)
	if err != nil {
		return fmt.Errorf("reading from database: %w", err)
	}

	if len(existing) == 0 {
		// find the blob in the filesystem
		blob, err := qb.fsStore.Read(ctx, checksum)
		if err != nil {
			return fmt.Errorf("reading from filesystem: %w", err)
		}

		// write the blob to the database
		if err := qb.update(ctx, checksum, blob); err != nil {
			return fmt.Errorf("writing to database: %w", err)
		}
	}

	if deleteOld {
		// delete the blob from the filesystem after commit
		if err := qb.fsStore.Delete(ctx, checksum); err != nil {
			return fmt.Errorf("deleting from filesystem: %w", err)
		}
	}

	return nil
}