fix(oracle): skip rowid for view data queries

This commit is contained in:
t8y2 committed 2026-07-04 17:07:43 +08:00
1 parent 7e7c4944e9
commit 223ecbec20
16 files changed
+78 -31

No files matched your search

@@ -2461,7 +2461,7 @@ const persistedColumnOrderKeys = ref<string[]>([]);
const displayableColumnIndexes = computed(() =>
props.result.columns
.map((column, index) => ({ column, index }))
.filter(({ column }) => !isHiddenGridColumn(props.databaseType, column, props.tableMeta?.primaryKeys ?? []))
.filter(({ column }) => !isHiddenGridColumn(props.databaseType, column, props.tableMeta?.primaryKeys ?? [], props.tableMeta?.tableType))
.map(({ index }) => index),
);
const goToColumnItems = computed(() =>
@@ -5004,7 +5004,7 @@ async function applyOrderBySearch() {
orderBy: orderByClause,
limit: pageSize.value,
whereInput: currentWhereInput(),
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys),
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType),
});
await props.onExecuteSql(sql);
} catch (e: any) {
@@ -5035,7 +5035,7 @@ async function applyWhereFilter() {
orderBy: orderByInput.value.trim() || (sortCol.value ? `${queryColumnRef(sortCol.value)} ${sortDir.value.toUpperCase()}` : undefined),
limit: pageSize.value,
whereInput,
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys),
includeRowId: usesSyntheticRowIdKey(resolvedDatabaseType.value, tableMeta.primaryKeys, tableMeta.tableType),
});
await props.onExecuteSql(sql);
} catch (e: any) {
@@ -51,6 +51,7 @@ const emit = defineEmits<{
database: string;
schema?: string;
tableName: string;
tableType?: string;
columnName?: string;
},
];
@@ -60,6 +61,7 @@ const emit = defineEmits<{
database: string;
schema?: string;
tableName: string;
tableType?: string;
whereInput?: string;
},
];
@@ -136,7 +136,7 @@ const emit = defineEmits<{
viewTableData: [tableName: string];
viewTableDdl: [tableName: string];
editTableStructure: [tableName: string];
openObjectTable: [target: { tableName: string; schema?: string }];
openObjectTable: [target: { tableName: string; schema?: string; tableType?: string }];
objectSchemaChange: [schema: string | undefined];
structureEditorSaved: [commentChanged: boolean];
structureEditorClose: [];
@@ -30,6 +30,7 @@ const emit = defineEmits<{
database: string;
schema?: string;
tableName: string;
tableType?: string;
columnName?: string;
},
];
@@ -268,6 +269,7 @@ function openItemTarget(item: FieldLineageItem) {
database: props.prefillDatabase,
schema: item.schema || props.prefillSchema,
tableName: item.table,
tableType: item.kind === "viewReference" ? "VIEW" : "TABLE",
columnName: item.column || props.prefillColumn,
});
}
@@ -96,7 +96,7 @@ const props = defineProps<{
}>();
const emit = defineEmits<{
openTable: [target: { tableName: string; schema?: string }];
openTable: [target: { tableName: string; schema?: string; tableType?: string }];
schemaChange: [schema: string | undefined];
}>();
@@ -661,7 +661,7 @@ async function saveFileContent(content: string, defaultFileName: string, filterN
}
function openViewData(row: ObjectBrowserRow) {
emit("openTable", { tableName: row.name, schema: row.schema });
emit("openTable", { tableName: row.name, schema: row.schema, tableType: row.type });
}
function openStructureEditor(row: ObjectBrowserRow) {
@@ -29,6 +29,7 @@ const emit = defineEmits<{
database: string;
schema?: string;
tableName: string;
tableType?: string;
whereInput?: string;
},
];
@@ -45,6 +46,7 @@ type SearchResultItem = {
id: string;
schema?: string;
tableName: string;
tableType?: string;
matchedColumns: string[];
preview: string;
whereInput: string;
@@ -223,6 +225,7 @@ async function searchTable(task: SearchTableTask, databaseType: DatabaseType, cu
id: `${tableLabel}:${rowIndex}:${results.value.length}`,
schema: task.schema,
tableName: task.table.name,
tableType: task.table.table_type,
matchedColumns,
preview: rowPreview(result.columns, row, matchedColumns),
whereInput,
@@ -257,6 +260,7 @@ function openResult(item: SearchResultItem) {
database: props.prefillDatabase,
schema: item.schema,
tableName: item.tableName,
tableType: item.tableType,
whereInput: item.whereInput,
});
}
@@ -1283,7 +1283,7 @@ async function openData() {
const columns = cachedTableMeta?.columns ?? [];
const primaryKeys = cachedTableMeta?.primaryKeys ?? [];
const includeRowId = usesSyntheticRowIdKey(effectiveDbType, primaryKeys);
const includeRowId = usesSyntheticRowIdKey(effectiveDbType, primaryKeys, tableType);
const sql = await buildTableSelectSql({
databaseType: effectiveDbType,
schema: tableSchema,