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

import (
	"context"
	"database/sql"
	"errors"
	"fmt"
	"io/fs"

	"github.com/doug-martin/goqu/v9"
	"github.com/doug-martin/goqu/v9/exp"
	"github.com/jmoiron/sqlx"
	"github.com/mattn/go-sqlite3"
	"github.com/stashapp/stash/pkg/file"
	"github.com/stashapp/stash/pkg/hash/md5"
	"github.com/stashapp/stash/pkg/logger"
	"github.com/stashapp/stash/pkg/sqlite/blob"
	"github.com/stashapp/stash/pkg/utils"
	"gopkg.in/guregu/null.v4"
)

const (
	blobTable          = "blobs"
	blobChecksumColumn = "checksum"
)

type BlobStoreOptions struct {
	// UseFilesystem should be true if blob data should
    
func (qb *BlobStore) readSQL(ctx context.Context, querySQL string, args ...interface{}) ([]byte, string, error) {
	if !qb.options.UseDatabase && !qb.options.UseFilesystem {
		panic("no blob store configured")
	}

	// always try to get from the database first, even if set to use filesystem
	var row blobRow
	found := false
	const single = true
	if err := qb.queryFunc(ctx, querySQL, args, single, func(r *sqlx.Rows) error {
		found = true
		if err := r.StructScan(&row); err != nil {
			return err
		}

		return nil
	}); err != nil {
		return nil, "", fmt.Errorf("reading from database: %w", err)
	}

	if !found {
		// not found in the database - does not exist
		return nil, "", nil
	}

	checksum := row.Checksum

	if row.Blob != nil {
		return row.Blob, checksum, nil
	}

	// don't use the filesystem if not configured to do so
	if qb.options.UseFilesystem {
		ret, err := qb.readFromFilesystem(ctx, checksum)
		if err != nil {
			return nil, checksum, err
		}

		return ret, checksum, nil
	}

	return nil, checksum, &ChecksumBlobNotExistError{
		Checksum: checksum,
	}
}