Skip to content

Commit

Permalink
Fixes missing placeholders in INSERT statement
Browse files Browse the repository at this point in the history
Co-authored-by: Florent <[email protected]>
  • Loading branch information
Spoffy and fflorent authored Jan 15, 2025
1 parent 337c128 commit a56cfa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/server/lib/DocStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ export class DocStorage implements ISQLiteDB, OnDemandStorage {
// This means it's not safe to check then insert - we just have to try the insert and see if it
// fails.
try {
await db.run('INSERT INTO _gristsys_Files (ident, data, storageId) VALUES (?)', fileIdent);
await db.run('INSERT INTO _gristsys_Files (ident, data, storageId) VALUES (?, ?, ?)', fileIdent);
} catch(err) {
// If UNIQUE constraint failed, this ident must already exist.
if (/^(SQLITE_CONSTRAINT: )?UNIQUE constraint failed/.test(err.message)) {
Expand Down

0 comments on commit a56cfa0

Please sign in to comment.