iansinnott/prompta

Delete server-side db

struanb opened this issue · 2 comments

I'd like to delete all my chats that are synced to the chat.prompta.dev db, as I'm planning to export my chats and reimport them under a new db ID (I believe my current db ID may have been exposed in logs I've shared on recent issues).

I could delete each chat manually but that would be laborious.

Can I suggest a 'delete all' function? A good place to put this might be in Settings under Advanced.

Yeah that makes sense, agree it would be a good option for the advanced section.

As a workaround, the database is exposed globally in the app as window.db so you can manually run arbitrary SQL against it using the javascript console:

await db.execO(`select count() from message;`)

Or to delete all messages and threads:

await db.exec(`delete from message;`);
await db.exec(`delete from thread;`);

That's neat, thank you.