fix sql query building (#220)

* fix sql query building

* adding deps (#221)

---------

Co-authored-by: jkennedyvz <65985482+jkennedyvz@users.noreply.github.com>
main
Joel Smith 2023-02-22 11:02:48 -08:00 committed by GitHub
parent 2558b4897b
commit 48768fbba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -127,7 +127,7 @@ jobs:
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update > /dev/null && sudo apt-get install -qqq libxcb-keysyms1-dev libxkbcommon-dev > /dev/null
sudo apt-get update > /dev/null && sudo apt-get install -qqq libxcb-keysyms1-dev libxkbcommon-dev libxkbcommon-x11-dev > /dev/null
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install ninja --ignore-checksums
fi

View File

@ -194,9 +194,8 @@ bool DatabaseConnection::setEvidenceTags(const QList<model::Tag> &newTags, qint6
// sqlite indicates it's default is 100 passed parameter, but it can "handle thousands"
if (!tagDataToInsert.empty()) {
QVariantList args;
baseQuery.append(QStringLiteral("(?, ?, ?"));
baseQuery.append(QStringLiteral("(?,?,?)"));
baseQuery.append(QString(", (?,?,?)").repeated(int(tagDataToInsert.size() - 1)));
baseQuery.append(QStringLiteral(")"));
for (const auto &item : tagDataToInsert) {
args.append(item.evidenceID);
args.append(item.tagID);