mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Support schemata other than main in the Browse Data tab
Similar to commit44eb2d4f99this commit makes use of the backend code improvements introduced in commit532fcd3f6b. 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user