mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
DBBrowserDB: Don't export sqlite_stat1 table when dumping DB
When creating a SQL dump of the database don't export the sqlite_stat1 table as it's impossible to import it later because SQLite generates it automatically.
This commit is contained in:
@@ -232,11 +232,21 @@ bool DBBrowserDB::dump(const QString& filename)
|
||||
// indices, views or triggers into account but compared to the number of rows those should be neglectable
|
||||
unsigned int numRecordsTotal = 0, numRecordsCurrent = 0;
|
||||
QList<DBBrowserObject> tables = objMap.values("table");
|
||||
for(QList<DBBrowserObject>::ConstIterator it=tables.begin();it!=tables.end();++it)
|
||||
QMutableListIterator<DBBrowserObject> it(tables);
|
||||
while(it.hasNext())
|
||||
{
|
||||
SqliteTableModel tableModel(0, this);
|
||||
tableModel.setTable((*it).getname());
|
||||
numRecordsTotal += tableModel.totalRowCount();
|
||||
it.next();
|
||||
|
||||
// Remove the sqlite_stat1 table if there is one
|
||||
if(it.value().getname() == "sqlite_stat1")
|
||||
{
|
||||
it.remove();
|
||||
} else {
|
||||
// Otherwise get the number of records in this table
|
||||
SqliteTableModel tableModel(0, this);
|
||||
tableModel.setTable(it.value().getname());
|
||||
numRecordsTotal += tableModel.totalRowCount();
|
||||
}
|
||||
}
|
||||
QProgressDialog progress(QObject::tr("Exporting database to SQL file..."),
|
||||
QObject::tr("Cancel"), 0, numRecordsTotal);
|
||||
|
||||
Reference in New Issue
Block a user