🐛 fix(query): 修正新建查询未引用 PostgreSQL 大写表名

- 抽取表查询模板 helper 并统一复用方言标识符引用逻辑
- 修正 Sidebar 与 TableOverview 的表节点新建查询入口
- 补充前端回归测试并更新 issue backlog 记录

Fixes #349
This commit is contained in:
Syngnat
2026-04-17 13:30:07 +08:00
parent d57081ecfb
commit 8a10519f9b
5 changed files with 37 additions and 7 deletions

View 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)};`;
};