fix(gbase8s): omit owner qualifier in table admin SQL

This commit is contained in:
New2Niu authored and GitHub committed 2026-09-14 14:52:13 +08:00
1 parent 6d866905b5
commit 1533064f1f
6 files changed
+37 -10

No files matched your search

@@ -72,7 +72,7 @@ import type { ColumnInfo, ConnectionConfig, ConstraintInfo, ForeignKeyInfo, Inde
import { sortTablesByFkDependency, type TableWithFk } from "@/lib/table/tableDependencySort";
import { isSchemaAware, supportsTableVacuum, supportsTransfer } from "@/lib/database/databaseCapabilities";
import { supportsAiAssistantContext, supportsSchemaDiagram, supportsTableImport, supportsTableStructureEditing, supportsTableTruncate } from "@/lib/database/databaseFeatureSupport";
import { codeMirrorSqlDialect, connectionObjectTreeNodeSchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection, objectListSchemaForConnection, tableStructureDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
import { codeMirrorSqlDialect, connectionObjectTreeNodeSchema, connectionTableSqlSchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection, objectListSchemaForConnection, tableStructureDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
import { getTableMetadataCapabilities, type TableMetadataCapabilities } from "@/lib/table/tableMetadataCapabilities";
import { constraintsForConstraintsTab } from "@/lib/table/constraintPresentation";
import { buildTableSelectSql } from "@/lib/table/tableSelectSql";
@@ -2531,7 +2531,7 @@ async function confirmPasteTable() {
function tableAdminSqlOptions(row: ObjectBrowserRow, options?: { cascade?: boolean }): TableAdminSqlOptions {
const result: TableAdminSqlOptions = {
databaseType: effectiveDatabaseType.value,
schema: row.schema || selectedSchema.value,
schema: connectionTableSqlSchema(props.connection, row.schema || selectedSchema.value),
tableName: row.name,
// Cloud Spanner's dialect decides the quote; the static per-type mapping cannot.
identifierQuote: connectionStore.connectionIdentifierQuote?.(props.connection.id),
@@ -162,7 +162,7 @@ import { buildViewDdl } from "@/lib/table/viewDdl";
import { formatSqlForDisplay, sqlFormatDialectForDbType } from "@/lib/sql/sqlFormatter";
import { omitDdlIdentifierQuotes } from "@/lib/sql/ddlDisplay";
import { getTableStructureCapabilities } from "@/lib/table/tableStructureCapabilities";
import { connectionObjectTreeNodeSchema, connectionObjectTreeQuerySchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection, tableStructureDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
import { connectionObjectTreeNodeSchema, connectionObjectTreeQuerySchema, connectionTableSqlSchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection, tableStructureDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
import { hasTreeNodeDatabaseContext } from "@/lib/sidebar/treeNodeContext";
import {
defaultPasteTableMode,
@@ -2798,11 +2798,13 @@ function batchTruncateConfirmMessage(): string {
async function dropSqlForTreeNode(node: TreeNode, options?: { cascade?: boolean }): Promise<string | null> {
if (node.type === "table" && node.connectionId && node.database) {
const config = connectionStore.getConfig(node.connectionId);
return buildDropTableSql({
databaseType: databaseTypeForNode(node),
schema: node.schema,
schema: connectionTableSqlSchema(config, node.schema),
tableName: node.label,
cascade: options?.cascade && supportsDropTableCascade(databaseTypeForNode(node)),
identifierQuote: connectionStore.connectionIdentifierQuote?.(node.connectionId),
});
}
const objectOptions = dropObjectSqlOptionsForNode(node);