loopbackio / loopbackio/loopback-next
How to perform joins on non-primary columns and complex select statements in loopback 4?
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 5.1k
- 派生
- 1.1k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 27
描述
Describe the bug
Hi i am new to loopback and need to create an API with business logic that contains several complex queries. I cant seem to find a way to join two tables with non-primary columns. For example, select * from e_c left join e on e.ed=e_c.ed Table relations: e_c.ed fk to ed table on id e.ed fk to ed table on id
On the same note writing complex select statements are also needed. For example, select (case when completed_on is null then 1 else 0 end) flag from e or select sum(rating) from f_b
Kindly provide some method by which these can be achieved via loopback 4
Logs
No response
Additional information
No response
Reproduction
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定源文件、测试或入口点。首先参考非主列连接和复杂 SELECT 示例,检查 LoopBack 4 的关系和查询 API;完成的标准是确定一种有文档说明的受支持方法,或明确记录限制和所需范围。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- api, backend, databases
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100