Viewing File: /opt/alt/python35/lib64/python3.5/sqlite3/__pycache__/dump.cpython-35.pyc



¨ÕYf	ã@sdd„ZdS)c
csz|jƒ}dVd}|j|ƒ}x|jƒD]÷\}}}|dkrVdVn7|dkrjdVn#|jdƒrq3ndj|ƒV|jd	d
ƒ}|jdj|ƒƒ}dd
„|jƒDƒ}	dj|djdd„|	Dƒƒƒ}|j|ƒ}
x |
D]}dj|dƒVqWq3Wd}|j|ƒ}x+|jƒD]\}}}dj|ƒVqPWdVdS)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";Zsqlite_stat1zANALYZE "sqlite_master";Zsqlite_z{0};ú"z""zPRAGMA table_info("{0}")cSs g|]}t|dƒ‘qS)é)Ústr)Ú.0Z
table_info©rú1/opt/alt/python35/lib64/python3.5/sqlite3/dump.pyú
<listcomp>3s	z_iterdump.<locals>.<listcomp>z2SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";ú,css*|] }dj|jddƒƒVqdS)z'||quote("{0}")||'rz""N)ÚformatÚreplace)rÚcolrrrú	<genexpr>6sz_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ÚresZcolumn_namesZ	query_resÚrowÚnamerrrÚ	_iterdump
s4			
rN)rrrrrÚ<module>
s
Back to Directory File Manager