feat(sqlite): support attached database schema changes
This commit is contained in:
41 files changed
+1219
-129
No files matched your search
@@ -40,13 +40,13 @@ export function normalizeObjectBrowserType(type: string): ObjectBrowserRow["type
|
||||
return "TABLE";
|
||||
}
|
||||
|
||||
export function buildObjectBrowserRows(options: { objects: ObjectInfo[]; database: string; fallbackSchema: string; needsSchema: boolean }): ObjectBrowserRow[] {
|
||||
export function buildObjectBrowserRows(options: { objects: ObjectInfo[]; database: string; fallbackSchema: string; rowSchema?: string }): ObjectBrowserRow[] {
|
||||
const seen = new Map<string, number>();
|
||||
const rows = options.objects.flatMap((object) => {
|
||||
const name = normalizeDatabaseObjectName(object.name);
|
||||
if (!name) return [];
|
||||
const objectSchema = object.schema ? normalizeDatabaseObjectName(object.schema) : undefined;
|
||||
const schema = objectSchema || (options.needsSchema ? options.fallbackSchema : undefined);
|
||||
const schema = objectSchema || options.rowSchema;
|
||||
const type = normalizeObjectBrowserType(object.object_type);
|
||||
const signature = routineSignatureForDisplay(type, object.signature);
|
||||
const displayName = signature === undefined ? name : `${name}(${signature})`;
|
||||
|
||||
@@ -69,7 +69,7 @@ export function qualifiedTableName(options: Pick<BuildTableSelectSqlOptions, "da
|
||||
}
|
||||
return quoteTableIdentifier(databaseType, tableName);
|
||||
}
|
||||
if (isSchemaAware(databaseType) && !usesDatabaseObjectTreeMode(databaseType) && schema) {
|
||||
if ((isSchemaAware(databaseType) || databaseType === "sqlite") && !usesDatabaseObjectTreeMode(databaseType) && schema) {
|
||||
if (databaseType === "sqlserver") {
|
||||
const linked = parseSqlServerLinkedSchema(schema);
|
||||
if (linked) return sqlServerLinkedTableName(linked, tableName);
|
||||
|
||||
Reference in new issue
Block a user