aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/schemaresolver.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/schemaresolver.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h
index cfb5bd5..c7b457f 100644
--- a/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h
+++ b/SQLiteStudio3/coreSQLiteStudio/schemaresolver.h
@@ -40,19 +40,37 @@ class API_EXPORT SchemaResolver
QString ddl;
};
+ struct TableListItem
+ {
+ enum Type
+ {
+ TABLE,
+ VIRTUAL_TABLE,
+ SHADOW_TABLE,
+ VIEW,
+ UNKNOWN
+ };
+
+ Type type;
+ QString name;
+ };
+
struct ObjectCacheKey
{
enum Type
{
OBJECT_NAMES,
OBJECT_DETAILS,
+ TABLE_LIST_ITEM,
OBJECT_DDL
};
ObjectCacheKey(Type type, Db* db, const QString& value1 = QString(), const QString& value2 = QString(), const QString& value3 = QString());
+ ObjectCacheKey(Type type, Db* db, bool skipSystemObj, const QString& value1 = QString(), const QString& value2 = QString(), const QString& value3 = QString());
Type type;
Db* db;
+ bool skipSystemObj;
QString value1;
QString value2;
QString value3;
@@ -76,6 +94,8 @@ class API_EXPORT SchemaResolver
QString getUniqueName(const QString& namePrefix = QString(), const QStringList& forbiddenNames = QStringList());
QStringList getFkReferencingTables(const QString& table);
QStringList getFkReferencingTables(const QString& database, const QString& table);
+ QStringList getFkReferencedTables(const QString& table);
+ QStringList getFkReferencedTables(const QString& database, const QString& table);
QStringList getIndexesForTable(const QString& database, const QString& table);
QStringList getIndexesForTable(const QString& table);
@@ -85,6 +105,13 @@ class API_EXPORT SchemaResolver
QStringList getTriggersForView(const QString& view);
QStringList getViewsForTable(const QString& database, const QString& table);
QStringList getViewsForTable(const QString& table);
+ QStringList getIndexDdlsForTable(const QString& database, const QString& table);
+ QStringList getIndexDdlsForTable(const QString& table);
+ QStringList getTriggerDdlsForTableOrView(const QString& database, const QString& table);
+ QStringList getTriggerDdlsForTableOrView(const QString& table);
+
+ QList<TableListItem> getAllTableListItems();
+ QList<TableListItem> getAllTableListItems(const QString& database);
StrHash<ObjectDetails> getAllObjectDetails();
StrHash<ObjectDetails> getAllObjectDetails(const QString& database);
@@ -131,6 +158,8 @@ class API_EXPORT SchemaResolver
*/
QStringList getTableColumns(const QString& database, const QString& table, bool onlyReal = false);
+ StrHash<DataType> getTableColumnDataTypesByName(const QString& table);
+ StrHash<DataType> getTableColumnDataTypesByName(const QString& database, const QString& table);
QList<DataType> getTableColumnDataTypes(const QString& table, int expectedNumberOfTypes = -1);
QList<DataType> getTableColumnDataTypes(const QString& database, const QString& table, int expectedNumberOfTypes = -1);
@@ -180,7 +209,6 @@ class API_EXPORT SchemaResolver
QString getSqliteAutoIndexDdl(const QString& database, const QString& index);
static QString getSqliteMasterDdl(bool temp = false);
- static QStringList getFkReferencingTables(const QString& table, const QList<SqliteCreateTablePtr>& allParsedTables);
static ObjectType objectTypeFromQueryType(const SqliteQueryType& queryType);
QStringList getCollations();
@@ -196,6 +224,7 @@ class API_EXPORT SchemaResolver
static QString objectTypeToString(ObjectType type);
static ObjectType stringToObjectType(const QString& type);
+ static TableListItem::Type stringToTableListItemType(const QString& type);
static void staticInit();
static_char* USE_SCHEMA_CACHING = "useSchemaCaching";
@@ -207,11 +236,12 @@ class API_EXPORT SchemaResolver
StrHash< QStringList> getGroupedObjects(const QString &database, const QStringList& inputList, SqliteQueryType type);
bool isFilteredOut(const QString& value, const QString& type);
void filterSystemIndexes(QStringList& indexes);
- QList<SqliteCreateTriggerPtr> getParsedTriggersForTableOrView(const QString& database, const QString& tableOrView, bool includeContentReferences, bool table);
+ QList<SqliteCreateTriggerPtr> getParsedTriggersForTableOrView(const QString& database, const QString& tableOrView, bool includeContentReferences);
QString getObjectDdlWithDifficultName(const QString& dbName, const QString& lowerName, QString targetTable, ObjectType type);
QString getObjectDdlWithSimpleName(const QString& dbName, const QString& lowerName, QString targetTable, ObjectType type);
StrHash<QString> getIndexesWithTables(const QString& database = QString());
QString normalizeCaseObjectNameByQuery(const QString& query, const QString& name);
+ QStringList getObjectDdlsReferencingTableOrView(const QString& database, const QString& table, ObjectType type);
template <class T>
StrHash<QSharedPointer<T>> getAllParsedObjectsForType(const QString& database, const QString& type);