From another user on a read-only database:

plxck3045> megatest -import-megatest.db
INFO: (0) Records count before clean: 505131

Error: with-transaction: uncaught exception: #f

Error: (step!) attempt to write a readonly database: #<sqlite3:statement sql="DELETE FROM tests WHERE run_id in (SELECT id FROM runs WHERE state='deleted') and last_update < 1560809468.0;">

        Call history:

        db.scm:1758: sqlite3#prepare
        db.scm:1757: g3151
        db.scm:1758: sqlite3#prepare
        db.scm:1757: g3151
        db.scm:1758: sqlite3#prepare
        db.scm:1757: g3151
        db.scm:1758: sqlite3#prepare
        db.scm:1757: g3151
        db.scm:1758: sqlite3#prepare
        db.scm:1780: sqlite3#with-transaction
        db.scm:1783: sqlite3#for-each-row
        db.scm:1784: debug:print-info
        common_records.scm:235: debug:debug-mode
        common_records.scm:236: port?
        common_records.scm:236: with-output-to-port
        db.scm:1786: g3179              <--