Support nested folders in `config/queries/` for query organization
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- sql, typescript
调研方向
先阅读 plugins/server/utils.js 中的 AppManager.getAppQuery()、getQueries(),以及 typegen 中的 generateQueriesFromDescribe(),然后检查它们对 flat readdir 和 path.basename 的处理。完成的标准是:嵌套的 .sql 文件能够解析为稳定的相对 query key,验证接受所选的 separator,并且类型生成和前端查找覆盖文档中的示例。
由索引模型根据 Issue 内容生成。
描述
Support nested folders in config/queries/ for query organization
Problem
As the number of SQL queries in a project grows, config/queries/ becomes a flat bag of files with no way to organize them by feature or domain. The only option is naming conventions (e.g. nego_chart_data.sql, trip_summary.sql), which doesn't scale well and provides no structural separation.
Current behavior
AppManagerhardcodesqueriesDirtopath.resolve(process.cwd(), "config/queries")fs.readdir()is non-recursive — subdirectories are silently ignored- Query key validation (
/^[a-zA-Z0-9_-]+$/) rejects any delimiter that could encode a path generate-types(typegen) also uses flatreaddir+path.basename
Proposed behavior
Allow queries to live in subdirectories:
config/queries/
negotiations/
chart_data.sql
spend_summary.sql
dashboard/
trip_summary.sql
trips_by_day.sql
docs/
annotations.obo.sql
Query key derivation would use the relative path with a separator (e.g. / or .):
negotiations/chart_dataornegotiations.chart_data
Frontend usage:
useAnalyticsQuery('negotiations/chart_data', params)
Minimal change required
The fix is small — roughly 3-4 locations need updating:
AppManager.getAppQuery()— changefs.readdir()tofs.readdir(dir, { recursive: true })and adjust filename matching to include relative subdirectory pathsgetQueries()inplugins/server/utils.js— same recursive readdir changegenerateQueriesFromDescribe()in typegen — derive query names from relative paths instead of justpath.basename()- Query key validation regex — allow
/or.as a path separator
Workarounds
Currently using prefix naming (nego_*, trip_*) which works but doesn't provide IDE folder navigation or structural grouping benefits.
- 主要语言
- TypeScript
- 星标
- 119
- 派生
- 36
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 37
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
databricks/appkit 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
databricks/appkit#729 ·
维护者通常 3 天内回复
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hours可能已有人在做 @billmcmillin 于 5 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 20/100
databricks/appkit#718 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
databricks/appkit#699 ·
维护者通常 3 天内回复
-
难度 3/5 半天 新手友好度 42/100
databricks/appkit#656 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 28/100
databricks/appkit#648 · 2 条评论 ·
维护者通常 3 天内回复
查看 databricks/appkit 的全部 Issue
相似的 Issue
-
Add "append" and "prepend" slots for vue-vuetify extended renderers可能已有人在做 @simeyc 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eclipsesource/jsonforms#2668 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
README の通知条件を実際の判定処理に合わせる可能已有人在做 @unhappychoice 今天认领。 未关闭factory:in-progress priority:medium
难度 1/5 1 小时以内 新手友好度 90/100
unhappychoice/oss-issue-opener#395 · 1 条评论 ·
维护者通常 1 天内回复
-
bug Website
难度 2/5 1-3 小时 新手友好度 77/100
OWASP/OWASP-Hunting#88 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复