mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Support SQL auto-completion for tables from different schemata
This improves commit 44eb2d4f99 by adding
support for auto completion in the SQL editors for all tables that are
not in the "main" schema.
This commit is contained in:
@@ -390,15 +390,18 @@ void MainWindow::populateStructure()
|
||||
return;
|
||||
|
||||
// Update table and column names for syntax highlighting
|
||||
objectMap tab = db.getBrowsableObjects("main");
|
||||
SqlUiLexer::TablesAndColumnsMap tablesToColumnsMap;
|
||||
for(auto it=tab.constBegin();it!=tab.constEnd();++it)
|
||||
for(auto it=db.schemata.constBegin();it!=db.schemata.constEnd();++it)
|
||||
{
|
||||
QString objectname = (*it)->name();
|
||||
objectMap tab = db.getBrowsableObjects(it.key());
|
||||
for(auto it=tab.constBegin();it!=tab.constEnd();++it)
|
||||
{
|
||||
QString objectname = (*it)->name();
|
||||
|
||||
sqlb::FieldInfoList fi = (*it)->fieldInformation();
|
||||
foreach(const sqlb::FieldInfo& f, fi)
|
||||
tablesToColumnsMap[objectname].append(f.name);
|
||||
sqlb::FieldInfoList fi = (*it)->fieldInformation();
|
||||
foreach(const sqlb::FieldInfo& f, fi)
|
||||
tablesToColumnsMap[objectname].append(f.name);
|
||||
}
|
||||
}
|
||||
SqlTextEdit::sqlLexer->setTableNames(tablesToColumnsMap);
|
||||
ui->editLogApplication->reloadKeywords();
|
||||
|
||||
Reference in New Issue
Block a user