Skip to content

Commit

Permalink
Update order of parameterized arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianUribe6 committed Mar 16, 2024
1 parent bc2c982 commit 93cbaa7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions apps/collab-server/src/turso-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ const tursoConfiguration: DatabaseConfiguration = {

async store({ documentName, state: documentData }) {
const now = new Date().getTime();
await client.execute({
const res = await client.execute({
sql: `UPDATE document
SET data = ?,
modifiedOn = ?
WHERE name = ?
`,
args: [documentName, now, documentData],
SET data = ?,
modifiedOn = ?
WHERE name = ?
`,
args: [documentData, now, documentName],
});

if (!res.rowsAffected) {
throw new Error(`Unable to update document with name ${documentName}`);
}
},
};

Expand Down

0 comments on commit 93cbaa7

Please sign in to comment.