mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-05 10:01:30 +08:00
🐛 fix(query): 修正新建查询未引用 PostgreSQL 大写表名
- 抽取表查询模板 helper 并统一复用方言标识符引用逻辑 - 修正 Sidebar 与 TableOverview 的表节点新建查询入口 - 补充前端回归测试并更新 issue backlog 记录 Fixes #349
This commit is contained in:
9
frontend/src/utils/objectQueryTemplates.ts
Normal file
9
frontend/src/utils/objectQueryTemplates.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { quoteQualifiedIdent } from './sql';
|
||||
|
||||
export const buildTableSelectQuery = (dbType: string, tableName: string): string => {
|
||||
const normalizedTableName = String(tableName || '').trim();
|
||||
if (!normalizedTableName) {
|
||||
return 'SELECT * FROM ';
|
||||
}
|
||||
return `SELECT * FROM ${quoteQualifiedIdent(dbType, normalizedTableName)};`;
|
||||
};
|
||||
Reference in New Issue
Block a user