Skip to content


Put full cell data into INSERT statements when dragging tables
Browse files Browse the repository at this point in the history
In the Structure tab you can drag & drop entire tables. This copies the
CREATE statement of the table along with the INSERT statements for the
table data. However, for the table data we would use the data as shown
in the table view cells, i.e. 'NULL' for NULL values or truncated data
for very long strings. This is at least partly improved by this commit.
It doesn't treat NULL or BLOB values 100% correctly but fixes the
truncation problem and at least makes the issues in the other cases a
bit more obvious.
  • Loading branch information
MKleusberg committed Jan 1, 2018
1 parent 106e57e commit 117af5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DbStructureModel.cpp
Expand Up @@ -222,7 +222,7 @@ QMimeData* DbStructureModel::mimeData(const QModelIndexList& indices) const
QString insertStatement = "INSERT INTO " + objid.toString() + " VALUES(";
for(int j=1; j < tableModel.columnCount(); ++j)
insertStatement += QString("'%1',").arg(, j)).toString());
insertStatement += QString("'%1',").arg(, j), Qt::EditRole).toString());
insertStatement += ");\n";
Expand Down

0 comments on commit 117af5a

Please sign in to comment.