feat(dev_tools): expand SQL query tool presets and fix column headers
Add 45 new preset queries covering all database tables, reorganize into platform-aligned sections (Infrastructure, Core, OMS, Loyalty, Hosting, Internal) with search/filter input. Fix column headers not appearing on SELECT * queries by capturing result.keys() before fetchmany(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -99,10 +99,9 @@ def execute_query(db: Session, sql: str) -> dict:
|
||||
|
||||
start = time.perf_counter()
|
||||
result = connection.execute(text(sql))
|
||||
columns = list(result.keys()) if result.returns_rows else []
|
||||
rows_raw = result.fetchmany(max_rows + 1)
|
||||
elapsed_ms = round((time.perf_counter() - start) * 1000, 2)
|
||||
|
||||
columns = list(result.keys()) if result.returns_rows else []
|
||||
truncated = len(rows_raw) > max_rows
|
||||
rows_raw = rows_raw[:max_rows]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user