mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-07 11:01:33 +08:00
🐛 fix(query-editor): 修复 Oracle 查询结果编辑提交失败
- 规范化 Oracle/Dameng 未加引号表名大小写 - 按元数据列名映射查询结果可写字段 - 补充查询结果编辑提交回归测试 Refs #464
This commit is contained in:
@@ -448,6 +448,13 @@ const findWritableResultColumnForSource = (writableColumns: Record<string, strin
|
||||
))?.[0];
|
||||
};
|
||||
|
||||
const resolveMetadataColumnName = (tableColumnNames: string[], sourceColumn: string): string => {
|
||||
const normalizedSource = String(sourceColumn || '').trim();
|
||||
if (!normalizedSource) return '';
|
||||
return tableColumnNames.find((column) => String(column || '').trim().toLowerCase() === normalizedSource.toLowerCase())
|
||||
|| normalizedSource;
|
||||
};
|
||||
|
||||
const buildQueryLocatorAlias = (column: string, index: number): string => {
|
||||
const normalized = String(column || '').trim().replace(/[^A-Za-z0-9_]/g, '_').slice(0, 48) || 'column';
|
||||
return `${QUERY_LOCATOR_ALIAS_PREFIX}${index}_${normalized}`;
|
||||
@@ -520,7 +527,8 @@ const resolveQueryLocatorPlan = async ({
|
||||
? Object.fromEntries(tableColumnNames.map((column) => [column, column]))
|
||||
: {};
|
||||
Object.entries(selectInfo.writableColumns).forEach(([resultColumn, sourceColumn]) => {
|
||||
writableColumns[resultColumn] = sourceColumn;
|
||||
const metadataColumn = resolveMetadataColumnName(tableColumnNames, sourceColumn);
|
||||
if (metadataColumn) writableColumns[resultColumn] = metadataColumn;
|
||||
});
|
||||
const appendExpressions: string[] = [];
|
||||
const hiddenColumns: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user