code: def DumpCurrentSchema(cursor):
    
    cursor.execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES "
                   "WHERE table_schema = (SELECT DATABASE())")
    defs = []
    for table, in sorted(cursor.fetchall()):
      cursor.execute("SHOW CREATE TABLE `{}`".format(table))
      rows = cursor.fetchall()
      defs.append(rows[0][1])
  
    return "\n\n".join(defs)
docs: Dumps current database schema.