mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-16 17:10:15 -05:00
Remove DBBrowserDB::tableColumns() method
Remove the DBBrowserDB::tableColumns() method which queries the database for the column names of a given table and which is used for the SQL export only. This function isn't needed at all because it generates a whole bunch of queries for data which is already hold in memory...
This commit is contained in:
+1
-14
@@ -428,7 +428,7 @@ bool DBBrowserDB::dump(const QString& filename,
|
||||
continue;
|
||||
|
||||
// get columns
|
||||
QStringList cols(tableColumns(it->getTableName()));
|
||||
QStringList cols(it->table.fieldNames());
|
||||
|
||||
QString sQuery = QString("SELECT * FROM `%1`;").arg(it->getTableName());
|
||||
QByteArray utf8Query = sQuery.toUtf8();
|
||||
@@ -1237,16 +1237,3 @@ bool DBBrowserDB::loadExtension(const QString& filename)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList DBBrowserDB::tableColumns(const QString & tableName) {
|
||||
QStringList cols;
|
||||
sqlite3_stmt* stmt = NULL;
|
||||
QString q(QString("PRAGMA table_info('%1');").arg(tableName));
|
||||
int rc = sqlite3_prepare_v2(this->_db, q.toUtf8(), q.toUtf8().length(), &stmt, NULL);
|
||||
if (rc == SQLITE_OK) {
|
||||
while (sqlite3_step(stmt) == SQLITE_ROW)
|
||||
cols.push_back(QString((const char*)sqlite3_column_text(stmt, 1)));
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
return cols;
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ public:
|
||||
bool executeSQL ( const QString & statement, bool dirtyDB=true, bool logsql=true);
|
||||
bool executeMultiSQL(const QString& statement, bool dirty = true, bool log = false);
|
||||
|
||||
QStringList tableColumns(const QString& tableName);
|
||||
|
||||
/**
|
||||
* @brief getRow Executes a sqlite statement to get the rowdata(columns)
|
||||
* for the given rowid.
|
||||
|
||||
Reference in New Issue
Block a user