Skip to content

Commit

Permalink
fixed sql queries wherer prepparams just inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Oct 9, 2024
1 parent 4532f4c commit ccaa685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ ipcRenderer.on('new-client', async (event) => {
function savedFileCheck(fileList) {
if (diskDB){
// Construct a parameterized query to count the matching files in the database
const query = `SELECT COUNT(*) AS count FROM files WHERE name IN (${prepParams(fileList)}`;
const query = `SELECT COUNT(*) AS count FROM files WHERE name IN (${prepParams(fileList)})`;

// Execute the query with the file list as parameters
diskDB.get(query, fileList, (err, row) => {
Expand Down Expand Up @@ -1677,7 +1677,7 @@ const saveResults2DataSet = ({species, included}) => {
ON species.id = records.speciesID
JOIN files ON records.fileID = files.id
WHERE confidence >= ${STATE.detect.confidence}`;
db2ResultSQL += filtersApplied(included) ? ` AND speciesID IN (${prepParams(included)}` : '';
db2ResultSQL += filtersApplied(included) ? ` AND speciesID IN (${prepParams(included)})` : '';

let params = filtersApplied(included) ? included : [];
if (species) {
Expand Down

0 comments on commit ccaa685

Please sign in to comment.