diff --git a/.gitignore b/.gitignore index 4fca1b7..add2716 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json # Finder (MacOS) folder config .DS_Store -*.db \ No newline at end of file +*.db +*.db-journal diff --git a/notes.db-journal b/notes.db-journal deleted file mode 100644 index d2a2942..0000000 Binary files a/notes.db-journal and /dev/null differ diff --git a/src/data/db.ts b/src/data/db.ts index 729b296..0034a51 100644 --- a/src/data/db.ts +++ b/src/data/db.ts @@ -80,6 +80,14 @@ export const saveCursor = (cursor: number) => { export const upsertNote = (note: Note) => { const now = new Date().toISOString(); + const params = [ + note.title, + note.publishedAt ? new Date(note.publishedAt).toISOString() : now, + note.createdAt ? new Date(note.createdAt).toISOString() : now, + note.did, + note.rkey, + ]; + console.log(`[db] upsertNote params: ${JSON.stringify(params)}`); db.query( ` @@ -96,12 +104,6 @@ export const upsertNote = (note: Note) => { title = excluded.title, publishedAt = excluded.publishedAt `, - [ - note.title, - note.publishedAt ? new Date(note.publishedAt).toISOString() : now, - note.createdAt ? new Date(note.createdAt).toISOString() : now, - note.did, - note.rkey, - ], + params, ); };