func (m *mysqlRepo) QueueFiles(ctx context.Context, counter int64) ([]noiseremover.File, error) {
	files := make([]noiseremover.File, 0)
	Tx, err := m.db.BeginTx(ctx, nil)
	if err != nil {
		return files, err
	}
	q := fmt.Sprintf("SELECT id, internal_name, uploaded_name,'"+string(noiseremover.ProgressQueued)+"' FROM %s "+
		"WHERE progress = ? ORDER BY created_at ASC LIMIT ? FOR UPDATE", (&File{}).TableName())
	results, err := Tx.Query(q, noiseremover.ProgressNew, counter)
	if err != nil {
		_ = Tx.Rollback()
		return files, err
	}
	for results.Next() {
		var file noiseremover.File
		err = results.Scan(&file.Id, &file.InternalName, &file.UploadedName, &file.Progress)
		if err != nil {
			return make([]noiseremover.File, 0), err
		}
		files = append(files, file)
	}
	if len(files) == 0 {
		err = Tx.Commit()
		if err != nil {
			return make([]noiseremover.File, 0), err
		}
		return files, nil
	}
	args := make([]interface{}, len(files))
	for i, f := range files {
		args[i] = f.Id
	}
	q = fmt.Sprintf("update %s set progress = 'queued' where id in (?"+strings.Repeat(",?", len(files)-1)+")",
		(&File{}).TableName())
	_, err = Tx.Exec(q, args...)
	if err != nil {
		_ = Tx.Rollback()
		return make([]noiseremover.File, 0), err
	}
	err = Tx.Commit()
	if err != nil {
		return make([]noiseremover.File, 0), err
	}
	return files, nil
}
use postgresql update... returning... instead
package mysql
import (
	"context"
	"database/sql"
	"fmt"
	"log"
	"strings"
	"time"
	_ "github.com/go-sql-driver/mysql"
	"github.com/normie7/nore/internal/noiseremover"
)
type File struct {
	Id           string
	InternalName string
	UploadedName string
	CreatedAt    time.Time
	Progress     noiseremover.Progress
}
func (f *File) TableName() string {
	return "files"
}
type mysqlRepo struct {
	db *sql.DB
}