;
Οβ"Ic               @   s   d    Z  d S(   c             c   sg  |  j    } d Vd } | j |  } xχ | j   D]ι \ } } } | d k o	 d Vn7 | d k o	 d Vn! | j d  o q3 n
 d | V| j d	 |  } d
   | j   D } d } | d j d   | D  7} | d 7} | j | i | d 6 }	 x |	 D] }
 d |
 d VqWq3 Wd } | j |  } x& | j   D] \ } } } d | VqBWd Vd S(   u/  
    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().
    u   BEGIN TRANSACTION;u   
        SELECT name, type, sql
        FROM sqlite_master
            WHERE sql NOT NULL AND
            type == 'table'
        u   sqlite_sequenceu   DELETE FROM sqlite_sequence;u   sqlite_stat1u   ANALYZE sqlite_master;u   sqlite_u   %s;u   PRAGMA table_info('%s')c             S   s%   g  } |  ] } | t  | d   q
 S(   i   (   u   str(   u   .0u   _[1]u
   table_info(    (    u)   /mit/python/lib/python3.0/sqlite3/dump.pyu
   <listcomp>,   s    u*   SELECT 'INSERT INTO "%(tbl_name)s" VALUES(u   ,c             S   s#   g  } |  ] } | d  | d q
 S(   u	   '||quote(u   )||'(    (   u   .0u   _[1]u   col(    (    u)   /mit/python/lib/python3.0/sqlite3/dump.pyu
   <listcomp>.   s    u   )' FROM '%(tbl_name)s'u   tbl_namei    u   
        SELECT name, type, sql
        FROM sqlite_master
            WHERE sql NOT NULL AND
            type IN ('index', 'trigger', 'view')
        u   COMMIT;N(   u   cursoru   executeu   fetchallu
   startswithu   join(   u
   connectionu   cuu   qu
   schema_resu
   table_nameu   typeu   sqlu   resu   column_namesu	   query_resu   rowu   name(    (    u)   /mit/python/lib/python3.0/sqlite3/dump.pyu	   _iterdump   s8    	 		
	
  N(   u	   _iterdump(    (    (    u)   /mit/python/lib/python3.0/sqlite3/dump.pyu   <module>   s    