#NEWLINE# def _finalize( self ) : #NEWLINE# #INDENT# "\n        Various last-minute stuff to perform after file has been parsed and\n        imported.\n\n        In general, if you'll be adding stuff to the meta table, do it here.\n        " #NEWLINE# c = self . conn . cursor ( ) #NEWLINE# c . executemany ( '\n                      INSERT INTO directives VALUES (?)\n                      ' , ( ( i , ) for i in c . iterator . directives ) ) #NEWLINE# c . execute ( '\n            INSERT INTO meta (version, dialect)\n            VALUES (:version, :dialect)' , dict ( version = version . version , dialect = helpers . _jsonify ( self . iterator . dialect ) ) ) #NEWLINE# c . executemany ( '\n            INSERT OR REPLACE INTO autoincrements VALUES (?, ?)\n            ' , list ( self . _autoincrements . items ( ) ) ) #NEWLINE# logger . info ( 'Creating relations(parent) index' ) #NEWLINE# c . execute ( 'DROP INDEX IF EXISTS relationsparent' ) #NEWLINE# c . execute ( 'CREATE INDEX relationsparent ON relations (parent)' ) #NEWLINE# logger . info ( 'Creating relations(child) index' ) #NEWLINE# c . execute ( 'DROP INDEX IF EXISTS relationschild' ) #NEWLINE# c . execute ( 'CREATE INDEX relationschild ON relations (child)' ) #NEWLINE# logger . info ( 'Creating features(featuretype) index' ) #NEWLINE# c . execute ( 'DROP INDEX IF EXISTS featuretype' ) #NEWLINE# c . execute ( 'CREATE INDEX featuretype ON features (featuretype)' ) #NEWLINE# logger . info ( 'Creating features (seqid, start, end) index' ) #NEWLINE# c . execute ( 'DROP INDEX IF EXISTS seqidstartend' ) #NEWLINE# c . execute ( 'CREATE INDEX seqidstartend ON features (seqid, start, end)' ) #NEWLINE# logger . info ( 'Creating features (seqid, start, end, strand) index' ) #NEWLINE# c . execute ( 'DROP INDEX IF EXISTS seqidstartendstrand' ) #NEWLINE# c . execute ( 'CREATE INDEX seqidstartendstrand ON features (seqid, start, end, strand)' ) #NEWLINE# logger . info ( 'Running ANALYSE features' ) #NEWLINE# c . execute ( 'ANALYZE features' ) #NEWLINE# self . conn . commit ( ) #NEWLINE# self . warnings = self . iterator . warnings