help wanted
仓库指标
- Star
- (19,563 star)
- PR 合并指标
- (平均合并 5天 16小时) (30 天内合并 138 个 PR)
描述
Problem
Want to join same table twice, but the key must be the cube name
Related Cube.js schema
// how to avoid this ?
cube(`CalleeUsers`, {
extends: Users,
});
cube(`PhoneCallEvents`, {
sql: `SELECT * FROM public.phone_call_events`,
joins: {
// want to use the key as CallerUser, but CallerUser cube not exists
Users: {
toCude: Users, // maybe support specify the target cube in here ?
relationship: `belongsTo`,
sql: `${PhoneCallEvents}.caller_object_id = ${Users}.id`,
},
// above cube make this work
CalleeUsers: {
relationship: `belongsTo`,
sql: `${PhoneCallEvents}.callee_object_id = ${CalleeUsers}.id`,
},
},
}
)
New to cubejs, don't know if there is a way to handle join same table twice.