def do_dump(self, line):
        '''.dump ?table?
Dumps a database into a sql string
If table is specified, dump that table.
'''
        try:
            if not line:
                for row in self.conn.iterdump():
                    self.display(row)
            else:
                conn = sqlite3.connect(':memory:')
                cu = conn.cursor()
                cu.execute("attach database '" + self.database + "' as attached_db")
                cu.execute("select sql from attached_db.sqlite_master " "where type='table' and name='" + line + "'")
                sql_create_table = cu.fetchone()[0]
                cu.execute(sql_create_table)
                cu.execute("insert into " + line + " select * from attached_db." + line)
                conn.commit()
                cu.execute("detach database attached_db")
                self.display("\n".join(conn.iterdump()))
        except:
            print('Invalid table specified')
.dump ?table?
Dumps a database into a sql string
If table is specified, dump that table.

bin/sqlite.py