Support schemata other than main in the Browse Data tab

Similar to commit 44eb2d4f99 this commit
makes use of the backend code improvements introduced in commit
532fcd3f6b.

It adds support for database schemata other than "main" to the Browse
Data tab. With this it's possible again to browse and edit data of
temporary tables using the Browse Data tab. This time, however, they are
separated logically from "main" tables. So handling temporary tables
should be a lot less error prone now, plus it's easier to tell for the
user what tables goes in what schema.

This commit changes the project file format. There is some code included
which allows loading of project files in the old format. However,
project files generated using versions after this commit can't be loaded
by older versions of DB4S.
This commit is contained in:
Martin Kleusberg
2017-09-04 12:27:52 +02:00
parent 1a3e3d3c40
commit ea1659e1d0
10 changed files with 107 additions and 58 deletions

View File

@@ -22,6 +22,28 @@ QStringList fieldVectorToFieldNames(const FieldVector& vector)
return result;
}
QDataStream& operator<<(QDataStream& ds, const ObjectIdentifier& objid)
{
ds << objid.toVariant();
return ds;
}
QDataStream & operator>>(QDataStream& ds, ObjectIdentifier& objid)
{
// Read in the item
QVariant v;
ds >> v;
// If it is a string list, we can treat it as an object identifier. If it isn't, we assume it's just a
// single string and use interpret it as the table name in the main schema. This is done for backwards
// compatability with old project file formats.
if(v.toStringList().isEmpty())
objid = sqlb::ObjectIdentifier("main", v.toString());
else
objid = sqlb::ObjectIdentifier(v);
return ds;
}
/**
* @brief The CreateTableWalker class
* Goes trough the createtable AST and returns