You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`INSERT OR IGNORE INTO message (id, session_id, time_created, time_updated, data) SELECT id, session_id, time_created, time_updated, data FROM global.message WHERE session_id IN (${ph})`,
456
+
)
457
+
.run(...ids)
458
+
dst
459
+
.query(
460
+
`INSERT OR IGNORE INTO part (id, message_id, session_id, time_created, time_updated, data) SELECT id, message_id, session_id, time_created, time_updated, data FROM global.part WHERE session_id IN (${ph})`,
461
+
)
462
+
.run(...ids)
463
+
dst
464
+
.query(
465
+
`INSERT OR IGNORE INTO todo (session_id, content, status, priority, position, time_created, time_updated) SELECT session_id, content, status, priority, position, time_created, time_updated FROM global.todo WHERE session_id IN (${ph})`,
466
+
)
467
+
.run(...ids)
468
+
dst
469
+
.query(
470
+
`INSERT OR IGNORE INTO event_sequence (aggregate_id, seq) SELECT aggregate_id, seq FROM global.event_sequence WHERE aggregate_id IN (${ph})`,
471
+
)
472
+
.run(...ids)
473
+
dst
474
+
.query(
475
+
`INSERT OR IGNORE INTO event (id, aggregate_id, seq, type, data, origin) SELECT id, aggregate_id, seq, type, data, origin FROM global.event WHERE aggregate_id IN (${ph})`,
476
+
)
477
+
.run(...ids)
478
+
}
479
+
dst.exec("COMMIT")
480
+
dst.run(meta)
481
+
for(constsidofids){
482
+
constmsg=src.query("SELECT MAX(time_created) as t FROM message WHERE session_id = ?").get(sid)as{
483
+
t: number|null
484
+
}|null
485
+
constpart=src.query("SELECT MAX(time_created) as t FROM part WHERE session_id = ?").get(sid)as{
486
+
t: number|null
487
+
}|null
488
+
consttodo=src.query("SELECT MAX(time_created) as t FROM todo WHERE session_id = ?").get(sid)as{
489
+
t: number|null
490
+
}|null
491
+
dst
492
+
.query("INSERT OR REPLACE INTO _meta (key, value) VALUES (?, ?)")
493
+
.run(`swept:msg:${sid}`,String(msg?.t??0))
494
+
dst
495
+
.query("INSERT OR REPLACE INTO _meta (key, value) VALUES (?, ?)")
496
+
.run(`swept:part:${sid}`,String(part?.t??0))
497
+
dst
498
+
.query("INSERT OR REPLACE INTO _meta (key, value) VALUES (?, ?)")
0 commit comments