Skip to content

Commit

Permalink
Don't use base table name where the actual table name is appropriate
Browse files Browse the repository at this point in the history
In the SQL export don't use the base table name of a table when you
should actually use the table name itself. The way SQLite reports its
data these just happen to be the same for tables.

This doesn't change anything when it comes to functionality but is
semantically more correct.
  • Loading branch information
MKleusberg committed Jan 23, 2017
1 parent 9266d20 commit 3839256
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqlitedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ bool DBBrowserDB::dump(const QString& filename,
// Loop through all tables first as they are required to generate views, indices etc. later
for(auto it=tables.constBegin();it!=tables.constEnd();++it)
{
if (tablesToDump.indexOf(it->getTableName()) == -1)
if (tablesToDump.indexOf(it->getname()) == -1)
continue;

// Write the SQL string used to create this table to the output file
Expand All @@ -505,7 +505,7 @@ bool DBBrowserDB::dump(const QString& filename,
// get columns
QStringList cols(it->object.dynamicCast<sqlb::Table>()->fieldNames());

QString sQuery = QString("SELECT * FROM %1;").arg(sqlb::escapeIdentifier(it->getTableName()));
QString sQuery = QString("SELECT * FROM %1;").arg(sqlb::escapeIdentifier(it->getname()));
QByteArray utf8Query = sQuery.toUtf8();
sqlite3_stmt *stmt;
QString lineSep(QString(")%1\n").arg(insertNewSyntx?',':';'));
Expand Down

0 comments on commit 3839256

Please sign in to comment.