feat(sqlite): support attached database schema changes

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-20 10:51:16 +08:00
1 parent 890fd70c05
commit 85836f8e95
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})`;
+1 -1
View File
@@ -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);