MINI MINI MANI MO
3
  \	  ã               @   s   d d„ Z dS )c       
      c   s  | j ƒ }dV  d}|j|ƒ}xÂ|jƒ D ]¶\}}}|dkr@dV  n*|dkrPdV  n|jdƒr^q&ndj|ƒV  |jd	d
ƒ}|jdj|ƒƒ}dd
„ |jƒ D ƒ}	dj|djdd„ |	D ƒƒƒ}|j|ƒ}
x|
D ]}dj|d ƒV  qÄW q&W d}|j|ƒ}x"|jƒ D ]\}}}dj|ƒV  qøW dV  dS )a/  
    Returns an iterator to the dump of the database in an SQL text format.
    Used to produce an SQL dump of the database.  Useful to save an in-memory
    database for later restoration.  This function should not be called
    directly but instead called from the Connection method, iterdump().
    zBEGIN TRANSACTION;zª
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" == 'table'
            ORDER BY "name"
        Zsqlite_sequencezDELETE FROM "sqlite_sequence";Zsqlite_stat1zANALYZE "sqlite_master";Zsqlite_z{0};ú"z""zPRAGMA table_info("{0}")c             S   s   g | ]}t |d  ƒ‘qS )é   )Ústr)Ú.0Z
table_info© r   ú$/usr/lib64/python3.6/sqlite3/dump.pyú
<listcomp>3   s    z_iterdump.<locals>.<listcomp>z2SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";ú,c             s   s    | ]}d j |jddƒƒV  qdS )z'||quote("{0}")||'r   z""N)ÚformatÚreplace)r   Úcolr   r   r   ú	<genexpr>6   s    z_iterdump.<locals>.<genexpr>é    z£
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" IN ('index', 'trigger', 'view')
        zCOMMIT;N)ZcursorZexecuteZfetchallÚ
startswithr	   r
   Újoin)
Z
connectionZcuÚqZ
schema_resZ
table_nameÚtypeZsqlZtable_name_identÚresZcolumn_namesZ	query_resÚrowÚnamer   r   r   Ú	_iterdump
   s4    		
	
r   N)r   r   r   r   r   Ú<module>
   s    
 OHA YOOOO