<s> import sqlite3 <EOL> def sqlite_table_layout ( sqlite_connection ) : <EOL> def row_count_and_column_names ( table_name ) : <EOL> cursor = sqlite_connection . execute ( "<STR_LIT>" . format ( table_name ) ) <EOL> return len ( cursor . fetchall ( ) ) , '<STR_LIT:U+002CU+0020>' . join ( x [ <NUM_LIT:0> ] for x in cursor . description ) <EOL> cursor = sqlite_connection . execute ( "<STR_LIT>" ) <EOL> table_dict = { x [ <NUM_LIT:0> ] : row_count_and_column_names ( x [ <NUM_LIT:0> ] ) for x in cursor . fetchall ( ) } <EOL> fmt = '<STR_LIT>' <EOL> return '<STR_LIT:\n>' . join ( fmt . format ( x , * table_dict [ x ] ) for x in sorted ( table_dict ) ) <EOL> with sqlite3 . connect ( '<STR_LIT>' ) as conn : <EOL> print ( sqlite_table_layout ( conn ) ) <EOL> '''<STR_LIT>''' </s>
