by sgbeal · 4y ago · 0 comments
There's no way to know what the db's state was when it was imported without literally keeping a second copy of the whole db solely for comparison's sake, then writing the code to perform the comparison. In the browser storage space, how much space is available for storing such copies is unknown (an unknowable, AFAIK), so we can't simply keep extra copies willy-nilly like we possibly could in an out-of-browser client-side app.
That said: a user can start their session with "BEGIN" and use "ROLLBACK" to revert to the original state.
The transaction would be left open until the user either decides to re-run the (presumably modified) query input (causing a rollback first) or to (presumably) end the session by downloading the database (causing a commit first). This behavior would only apply in the auto-resetting “fiddle mode”, of course.
Anyways, it was just an idea I was thinking about. I’m sure this idea is not flawless, and you probably have other, higher priority features in mind.