logs: add log for upserts

This commit is contained in:
Julien Calixte
2026-02-14 22:37:07 +01:00
parent a7a90ea075
commit d950d5cb48
2 changed files with 3 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ jetstream.onCreate("space.remanso.note", (event) => {
jetstream.onUpdate("space.remanso.note", (event) => {
const { did, commit: { rkey, record } } = event;
const note = record as unknown as Omit<Note, "did" | "rkey">
console.log(`[jetstream] update ${did}/${rkey}: ${note.title}`);
console.log(`[jetstream] update ${did}/${rkey}: ${note.title}, published at ${note.publishedAt}`);
upsertNote({
did,

View File

@@ -58,7 +58,8 @@ export const deleteNote = ({ did, rkey }: { did: string; rkey: string }) => {
};
export const upsertNote = (note: Note) => {
const now = new Date().toISOString()
const now = new Date().toISOString()
db.query(
`
INSERT INTO note (