public static function writeAll(Configuration $configuration, $ignoredTablesRegex = null) {
        $results = $configuration->getConnection()->query('SHOW FULL TABLES WHERE Table_Type!="VIEW"');
        while($result = $results->fetch()) {
            $result = (object)$result;
            $table = null;
            foreach($result as $column) {
                $table = $column;
                break;
            }
            if(!is_null($ignoredTablesRegex) && preg_match($ignoredTablesRegex, $table)) {
                continue;
            }
            echo 'Writing: '.$table."\n";
            $index = new self($configuration, $table);
            $index->write();
        }
    }